Laravel Collection Public API: pull
The pull method in Laravel's Collection class removes an item from the collection and returns its value. If the item does not exist, an optional default value can be provided. After executing the method, the original collection will be modified.