Laravel - Collections - Method Put

The put method sets the given key and value in the collection:

    
    $collection = collect(['product_id' => 1, 'name' => 'Desk']);
    
    $collection->put('price', 100);
    
    $collection->all();
    
    // ['product_id' => 1, 'name' => 'Desk', 'price' => 100]