When I click to go to Page 2, I get directed to the homepage of my website. Not sure why.
Here's the pagination code in the controller file:
public function paginate($items, $perPage = 15, $page = null, $options = [])
{
$page = $page ?: (Paginator::resolveCurrentPage() ?: 1);
$items = $items instanceof Collection ? $items : Collection::make($items);
return new LengthAwarePaginator(
$items->forPage($page, $perPage),
$items->count(),
$perPage,
$page,
$options
);
}
In the view file:
@if(!isset($_REQUEST['fees'])) {{
$result->appends([
'FeesRange' => request('FeesRange'),
'sortby' => request('sortby'),
'location' => request('location'),
'searchItem' => request('searchItem'),
'searchLocation' => request('searchLocation'),
'criteria' => request('criteria'),
'search' => request('search')
])->links()
}}
@endif