collection laravel remove code example
Example: laravel collection remove item
forget()
The forget method removes an item from the collection by its key:
$collection = collect(['name' => 'taylor', 'framework' => 'laravel']);
$collection->forget('name');
$collection->all();
// ['framework' => 'laravel']
Another example
$permissions->forget([2, 3, 4]);
Source
https://laravel.com/docs/8.x/collections#method-forget