laravel/laravel — pull request #1300 by kapv89 (2012-09-30 21:41:59+00:00)
Title: Added functionality to aggregate eager loads

In doing to doing things like this:

User::with(array('comments' => function ($q) { $q->where('date', >, 'Whatever'); }))->get();

You can also do things like this:

User::with(array(
'comments' => array(
'where' => function ($q) { $q->where('whatever'); },
'aggregate => function ($q) { $q->limit(5)->select('id', 'text'); }
)
))->get();