samedi 29 avril 2017

Order by relationship - Laravel 5

I've seen a couple of times Laravel people order by a relation like this:

Model::with(["relationship" => function($query) {
    $query->orderBy('relation_property');
}]);

I've never got this working. Although, it seams like many people is using it. Does someone having an idea why I cant get it to order the result by the relations property?



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

Aucun commentaire:

Enregistrer un commentaire