I have a query returning hundreds of database records.
As I am trying to paginate it using Laravel 4.2 method. Links are showing and they direct me to search-view?page=1
and so on, but the links open empty pages with no results. Only the first page contains results.
When I am trying to show these results without pagination the page never ends so I need to have it paginated.
Controller:
$results = $this->model->where($searchByColumn, '=', $searchKey)
->paginate(30);
return View::make('search-view')
->with('results', $results);
View:
@foreach ($results as $result)
{{$result}} <br>
@endforeach
{{$results->links()}}
Any help on this please?
search-view
and its controller – Mahdi Younesipaginate($30, ['*'], 'page', $request->page);
– Sohel0415APP_DEBUG=true
? No errors in the log? – brombeer