with relationship get multiple data with ascending 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');
}]);