laravel create with merge method code example
Example 1: merge collections laravel
$collection = collect(['product_id' => 1, 'price' => 100]);
$merged = $collection->merge(['price' => 200, 'discount' => false]);
$merged->all();
// ['product_id' => 1, 'price' => 200, 'discount' => false]
Example 2: pluck laravel
$name = DB::table('users')->where('name', 'John')->pluck('name');