lundi 30 avril 2018

Eloquent order relationship results

I have a simple eloquent query and want to include another table with my results, however, the order of relationship results is incorrect.

Is it possible to order the results without using an SQLRAW statement

$groups = AttributeGroup::with('attribute')->where('page_id', $page->id)->get();

What I would like -

$groups = AttributeGroup::with('attribute')->orderBy('iteration', 'DESC')->where('page_id', $page->id)->get();



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2jiSekY
via IFTTT

Aucun commentaire:

Enregistrer un commentaire