Manual Pagination Error - Laravel 5.0
Asked Answered
H

2

2

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.

Herlindaherm answered 7/3, 2015 at 20:15 Comment(2)
More code please... cmon if you want help post everything relevant you've got so people don't need to ask for it.Linea
The error message is pretty straightforward - you're trying to use a method that doesn't exist. Try passing the same data to the constructor of Illuminate\Pagination\Paginator (or LengthAwarePaginator, depending on your needs) instead.Hibbard
V
3

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()

Vrablik answered 7/3, 2015 at 22:33 Comment(0)
R
0

Remove those two:

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

That's all.

Regurgitation answered 7/3, 2015 at 22:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.