Question: I have a problem here, I want to combine 2 arrays into 1, I've tried using array\_merge from php, and merge () from laravel but nothing works 
//$plucked is EAV database

```
$vendor = Vendor::find($id)->toArray();
        $vendor_detail = Vendor_detail::where('vendor_id',$id)->get();
        $plucked = $vendor_detail->pluck('vendor_name','vendor_value');

        $merged = array_merge($plucked, $vendor);

        // $merged = $vendor->merge($plucked)->all(); 
        dd($merged);

```

I think because the array is different, there array $plucked

```
#items: array:10 [▼
    "user_email" => "cobaupdatelagi@gmail.com"

  ]

```

and there my array in $vendor

```

array:15 [▼
  "vendor_id" => 39
  "province" => "ACEH"

]

```

the output that I want

```
$somearray =[
   "vendor_id" => 39
  "province" => "ACEH"
  "user_email" => "cobaupdatelagi@gmail.com"

]

```

Answer: 
```
$vendor = Vendor::find($id);
$vendor_detail = Vendor_detail::select('vendor_id','province')->where('vendor_id',$id)->get()->toArray();

$data= array_merge($vendor,$vendor_detail);

```
```
  $vendor_detail = Vendor_detail::where('vendor_id',$id)->get(); will give you a collection

```

as well as `$plucked = $vendor_detail->pluck('vendor_name','vendor_value');` will give you a collection, so, either you can use collection [merge](https://laravel.com/docs/5.8/collections#method-merge) or you may like to loop through one and add merge another as other answer is doing, but these are not array, you are getting collections.