Don't overwrite pagination counts, let it default to the config #162
This commit is contained in:
parent
6993cba55a
commit
208b6e73dc
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user