我有一个返回数百个数据库记录的查询 .

因为我试图使用Laravel 4.2方法对其进行分页 . 链接显示,他们指示我 search-view?page=1 等等,但链接打开空白页没有结果 . 只有第一页包含结果 .

当我试图在没有分页的情况下显示这些结果时,网页永远不会结束,所以我需要对它进行分页 .

$results = $this->model->where($searchByColumn, '=', $searchKey)
                           ->latest('datetime')
                           ->paginate(30);

现在我试图将这些结果纳入我的观点 .

return View::make('search-view')
            ->with('results', $results);

视图:

@foreach ($results as $result)
   {{$result}} <br>
@endforeach

{{$results->links()}}

对此有何帮助?