Laravel - Collections - Method Toquery

The toQuery method returns an Eloquent query builder instance containing a whereIn constraint on the collection model's primary keys:

    
    use App\Models\User;
    
    $users = User::where('status', 'VIP')->get();
    
    $users->toQuery()->update([
        'status' => 'Administrator',
    ]);