Manual Pagination Error - Laravel 5.0

ⅰ亾dé卋堺 提交于 2019-12-11 03:43:39

问题


I am getting the following error while passing an array, count(array) and itemsPerPage as arguments. Call to undefined method Illuminate\Pagination\Paginator::make()

I tried following with it but cant fix the error.

use Illuminate\Pagination\LengthAwarePaginator as Paginator;
use Illuminate\Pagination;
use Illuminate\Support\Facades\Paginator;
use Illuminate\Pagination\Factory;
use App\Response;

make method is defined in http://laravel.com/api/5.0/Illuminate/Pagination/Environment.html#method_make document.


回答1:


Maybe try to remove these lines:

use Illuminate\Pagination\LengthAwarePaginator as Paginator;
use Illuminate\Support\Facades\Paginator;

Then add this:

use Illuminate\Pagination\Paginator;

Then use $paginator->render() instead of make()




回答2:


Remove those two:

use Illuminate\Pagination\LengthAwarePaginator as Paginator;
use Illuminate\Pagination;

That's all.



来源:https://stackoverflow.com/questions/28919497/manual-pagination-error-laravel-5-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!