laravel/framework — pull request #5439 by benubird (2014-08-13 10:08:48+00:00)
Title: Modified collection each method to be runnable fluently

Adapted the collection models each() method so that it can be run as part of a fluent query.

Previously, if you wanted to run (for instance) update(array('a' => $x)) on each element of a collection, you had to do something like this:

```
$collection->each(function($c) use($x){
$c->update(array('a' => $x));
});
```

Which is horribly untidy. But now, you can do this:

$collection->each()->update(array('a' => $x));

Which is much neater!