Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel orderby with relation

$users = User::with(['student' => function ($q) {
            $q->orderBy('id', 'desc');
        }]);
Source by laracasts.com #
 
PREVIOUS NEXT
Tagged: #laravel #orderby #relation
ADD COMMENT
Topic
Name
2+4 =