This is because in the old paginator any functions that weren't defined in the paginator class it would defer them onto the collection. The chunk function is actually part of Illuminate\Support\Collection -- not sure why Taylor has removed the dynamic call functionality, possibly just forgotten to add it back in.
Oct 10, 2014
9
Level 16
Laravel 5 Paginator chunk error
I know Taylor completely rewritten the paginator class so there might be a few things a miss with it potentially. However, has anyone come across this error?
Call to undefined method Illuminate\Pagination\Paginator::chunk()
This worked a few days ago when I last updated it. (... just to skip unnecessary stuff)
@foreach($recipes->chunk(3) as $recipeChunk)
...
@foreach($recipeChunk as $recipe)
...
@endforeach
...
@endforeach
Please or to participate in this conversation.