Laravel 5 - Manual pagination

laravel, laravel-5, laravel-pagination, pagination

Solution

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;

Problem

`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?

Original source