手动分页错误 - Laravel 5.0

时间:2015-03-07 20:15:42

标签: php laravel laravel-5 laravel-pagination

在传递数组count(array)itemsPerPage作为参数时,我收到以下错误。 Call to undefined method Illuminate\Pagination\Paginator::make()

我试过跟着它,但无法解决错误。

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

make方法在http://laravel.com/api/5.0/Illuminate/Pagination/Environment.html#method_make文档中定义。

2 个答案:

答案 0 :(得分:3)

也许尝试删除这些行:

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

然后添加:

use Illuminate\Pagination\Paginator;

然后使用$paginator->render()代替make()

答案 1 :(得分:0)

删除这两个:

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

这就是全部。