i want paginate a array with LengthAwarePaginator in Laravel.
when i try navigate between pages, laravel show this error:
NotFoundHttpException in RouteCollection.php line 161
mi code are:
//$queries1 is an array.
$currentPage = LengthAwarePaginator::resolveCurrentPage();
$collection = new Collection($queries1);
$currentPageSearchResults = $collection->slice($currentPage * 5, 5)->all();
$paginatedSearchResults= new LengthAwarePaginator($currentPageSearchResults, count($collection), 5);
//configure Path
$paginatedSearchResults->setPath(App::getLocale().'/activity/search_Activity');
return view(App::getLocale().'.activities.ActivityResults', ['results' => $paginatedSearchResults]);
if i try don´t set the path, the link of the pagination, automatically redirect to '/'
What could be happening?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire