laravel/framework — pull request #3852 by JosephSilber (2014-03-11 03:34:39+00:00)
Title: Add a chunk method to Collection

Let's add a `chunk` method to `Collection`. We already implement most of php's array methods, so why not.

People ask about this a lot in IRC, since it's very handy when building a grid out of items:

```html
@foreach( $collection->chunk(3) as $chunk )

@foreach( $chunk as $record )

@endforeach

@endforeach
```

Note that `$chunk`s themselves are collections :)