Commit 95c68d8c authored by Viral Solani's avatar Viral Solani

Merge branch 'develop' of https://github.com/viralsolani/laravel-adminpanel into develop

parents 252943e0 5d23ad54
...@@ -31,12 +31,12 @@ class PermissionController extends APIController ...@@ -31,12 +31,12 @@ class PermissionController extends APIController
*/ */
public function index(Request $request) public function index(Request $request)
{ {
$limit = $request->get('paginate') ? $request->get('paginate') : 25; $limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC'; $orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at'; $sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';
return PermissionResource::collection( return PermissionResource::collection(
$this->repository->getForDataTable()->orderBy($sortBy,$orderBy)->paginate($limit) $this->repository->getForDataTable()->orderBy($sortBy, $orderBy)->paginate($limit)
); );
} }
......
...@@ -31,12 +31,12 @@ class RolesController extends APIController ...@@ -31,12 +31,12 @@ class RolesController extends APIController
*/ */
public function index(Request $request) public function index(Request $request)
{ {
$limit = $request->get('paginate') ? $request->get('paginate') : 25; $limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC'; $orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at'; $sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';
return RoleResource::collection( return RoleResource::collection(
$this->repository->getForDataTable()->orderBy($sortBy,$orderBy)->paginate($limit) $this->repository->getForDataTable()->orderBy($sortBy, $orderBy)->paginate($limit)
); );
} }
......
...@@ -31,12 +31,12 @@ class UsersController extends APIController ...@@ -31,12 +31,12 @@ class UsersController extends APIController
*/ */
public function index(Request $request) public function index(Request $request)
{ {
$limit = $request->get('paginate') ? $request->get('paginate') : 25; $limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC'; $orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at'; $sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';
return UserResource::collection( return UserResource::collection(
$this->repository->getForDataTable(1, false)->orderBy($sortBy,$orderBy)->paginate($limit) $this->repository->getForDataTable(1, false)->orderBy($sortBy, $orderBy)->paginate($limit)
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment