I\'m new to laravel (switched from CI) and eloquent ORM is still a bit of a mystery at some point!
Here is my problem :
I\'d like to sort data from my db usi
Something like this could help.
$content = Posts::with(array('comments' => function($query) { $query->order_by('created_at', 'asc'); })) ->get();
Or if your problem is more complex:
How to sort by a field of the pivot table of a many-to-many relationship in Eloquent ORM