1$collection = collect(['product_id' => 1, 'price' => 100]);
2
3$merged = $collection->merge(['price' => 200, 'discount' => false]);
4
5$merged->all();
6
7// ['product_id' => 1, 'price' => 200, 'discount' => false]
1$collection = collect(['John Doe']);
2
3$concatenated = $collection->concat(['Jane Doe'])->concat(['name' => 'Johnny Doe']);
4
5$concatenated->all();
6
7// ['John Doe', 'Jane Doe', 'Johnny Doe']
1$collection = collect(['name', 'age']);
2
3$combined = $collection->combine(['George', 29]);
4
5$combined->all();
6
7// ['name' => 'George', 'age' => 29]