Answers for "laravel many to many get order by sub model"

PHP
-1

laravel orderby with relation

$users = User::with(['student' => function ($q) {
            $q->orderBy('id', 'desc');
        }]);
Posted by: Guest on May-04-2020

Code answers related to "laravel many to many get order by sub model"

Browse Popular Code Answers by Language