2

传递数组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文档中定义。

4

2 回答 2

3

也许尝试删除这些行:

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

然后添加这个:

use Illuminate\Pagination\Paginator;

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

于 2015-03-07T22:33:20.720 回答
0

删除这两个:

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

就这样。

于 2015-03-07T22:49:57.423 回答