Hi,
The following code should also work (note, that latest() is a shortcut for orderBy('created_at','desc'); see https://github.com/laravel/framework/blob/233196cbef18c45a5775009528ffd8bbcbdf8af5/src/Illuminate/Database/Query/Builder.php#L897 for more information)
$user = User::with(array('transactions' => function($query){ $query->latest(); }))->find($id);</code>
Hi,
The following code should also work (note, that latest() is a shortcut for orderBy('created_at','desc'); see https://github.com/laravel/framework/blob/233196cbef18c45a5775009528ffd8bbcbdf8af5/src/Illuminate/Database/Query/Builder.php#L897 for more information)
$user = User::with(array('transactions' => function($query){ $query->latest(); }))->find($id);</code>