It seems that you have to slice manually. From the Laravel 5.1 doc:
"When manually creating a paginator instance, you should manually "slice" the array of results you pass to the paginator."
So the answer is:
$arr = $all->toArray();
$offset = ($currentPage * $perPage) - $perPage;
$arr_splice = array_slice($arr, $offset, $perPage, true);
$paginator = new Paginator($arr_splice, count($arr), $perPage, $currentPage);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community