Don't overwrite pagination counts, let it default to the config #162

This commit is contained in:
Nabeel Shahzad 2018-02-28 15:06:57 -06:00
parent 6993cba55a
commit 208b6e73dc
5 changed files with 9 additions and 6 deletions

View File

@ -41,7 +41,9 @@ class AirportController extends BaseController
}
$this->airportRepository->pushCriteria(new WhereCriteria($request, $where));
$airports = $this->airportRepository->orderBy('icao', 'asc')->paginate(40);
$airports = $this->airportRepository
->orderBy('icao', 'asc')
->paginate();
return view('admin.airports.index', [
'airports' => $airports,

View File

@ -27,9 +27,10 @@ class AirlineController extends RestController
*/
public function index(Request $request)
{
#$this->airlineRepo->pushCriteria(new RequestCriteria($request));
$airports = $this->airlineRepo
->whereOrder(['active' => true], 'name', 'asc')
->paginate(50);
->paginate();
return AirlineResource::collection($airports);
}

View File

@ -37,7 +37,7 @@ class AirportController extends RestController
$airports = $this->airportRepo
->whereOrder($where, 'icao', 'asc')
->paginate(50);
->paginate();
return AirportResource::collection($airports);
}
@ -53,7 +53,7 @@ class AirportController extends RestController
$airports = $this->airportRepo
->whereOrder($where, 'icao', 'asc')
->paginate(50);
->paginate();
return AirportResource::collection($airports);
}

View File

@ -28,7 +28,7 @@ class UserController extends Controller
{
return $this->view('users.index',[
'country' => new \League\ISO3166\ISO3166(),
'users' => $this->userRepo->orderBy('name', 'desc')->paginate(25),
'users' => $this->userRepo->orderBy('name', 'desc')->paginate(),
]);
}
}

View File

@ -44,7 +44,7 @@ abstract class BaseRepository extends \Prettus\Repository\Eloquent\BaseRepositor
* @param string $sort_by created_at (default) or updated_at
* @return mixed
*/
public function recent($count = 5, $sort_by = 'created_at')
public function recent($count = null, $sort_by = 'created_at')
{
return $this->orderBy($sort_by, 'desc')->paginate($count);
}