1$users = User::with(['student' => function ($q) {
2 $q->orderBy('id', 'desc');
3 }]);
1$order = 'desc';
2$users = User::join('roles', 'users.role_id', '=', 'roles.id')->orderBy('roles.label', $order)->select('users.*')->paginate(10);
3
1$counties = County::whereHas('items', function ($query) {
2 $query->where('approved', 1);
3})->orderBy('name')->get();