📜  laravel collection put - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:34.532000             🧑  作者: Mango

代码示例3
$collection = collect(['product_id' => 1, 'name' => 'Desk']);

$collection->put('price', 100);

$collection->all();

// ['product_id' => 1, 'name' => 'Desk', 'price' => 100]