I seem to be unable to manually create an instance of the paginator.
use Illuminate\Pagination\Paginator;
class Blah {
public function index(Paginator $paginator)
{
// Build array
$var = $paginator->make($array, $count, 200);
return $var;
}
}
From here I'm just getting Unresolvable dependency resolving [Parameter #0 [ <required> $items ]] in class Illuminate\Pagination\Paginator
There is no more make() method in laravel 5. You need to create an instance of either an Illuminate\Pagination\Paginator
or Illuminate\Pagination\LengthAwarePaginator
. Take a look at documentation page, Creating A Paginator Manually part
http://laravel.com/docs/master/pagination
I guess it'll look something like this:
use Illuminate\Pagination\Paginator;
class Blah {
public function index()
{
// Build array
$array = [];
return new Paginator($array, $perPage);;
}
}
Also check this answer.