laravel search in relation orderby code example
Example: laravel orderby with relation
$users = User::with(['student' => function ($q) {
$q->orderBy('id', 'desc');
}]);
$users = User::with(['student' => function ($q) {
$q->orderBy('id', 'desc');
}]);