Laravel - Collections - Method Pull

The pull method removes and returns an item from the collection by its key:

    
    $collection = collect(['product_id' => 'prod-100', 'name' => 'Desk']);
    
    $collection->pull('name');
    
    // 'Desk'
    
    $collection->all();
    
    // ['product_id' => 'prod-100']