Pagination::make()
method doesn't exist in Pagination class anymore in Laravel 5.
Is there a workaround to make manual pagination work in Laravel 5?
There are several ways to paginate items. The simplest is by using the paginate method on the query builder or an Eloquent query. The paginate method provided by Laravel automatically takes care of setting the proper limit and offset based on the current page being viewed by the user.
Pagination works by selecting a specific chunk of results from the database to display to the user. The total number of results is calculated and then split between pages depending on how many results you want to return on a page.
You need to add use:
use Illuminate\Pagination\LengthAwarePaginator as Paginator;
and now you can use:
$paginator = new Paginator($items, $count, $limit, $page, [
'path' => $this->request->url(),
'query' => $this->request->query(),
]);
to get data in the same format as paginating on model object;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With