Laravel - Collections - Method Intersect

The intersect method returns all of the models that are also present in the given collection:

    
    use App\Models\User;
    
    $users = $users->intersect(User::whereIn('id', [1, 2, 3])->get());