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
*/
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';
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
*/
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';
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
*/
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';
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