I have this endpoint where I want to utilize pagination:
public function list() {
return Cache::remember('list_albums_'.App::getLocale(), 60, function () {
return Album::with(['group', 'event', 'event.translation'])
->orderBy('id', 'desc')
->simplePaginate(12);
});
}
However, the same 12 results are always returned. The network request shows that ?page=X is being sent, but the response is always identical.
Route:
Route::get('/albums/{page?}', 'AlbumController@list');