$user_ids = [1, 3, 5, 9]; $users = User::whereIn('id', $user_ids)->get();
$roles = ['admin', 'moderator']; $users = User::whereIn('role', $roles)->get();This returns a collection of User objects that have the specified roles. The whereIn method is part of the Laravel framework's Eloquent ORM library which makes it easy to work with databases.