Я хочу, чтобы объединить два массива в Laravel 5.3.I имеет переменную «$ типа», которые возвращаютобъединить два значения массива в Laravel
`Illuminate\Support\Collection Object ([items:protected] => Array ([1] => rinu)`
, который получает из запроса
$type0=DB::table('users')->where('name','=',$head)->pluck('name','id');
Я хочу для объединения с массивом $ type1, который возвращает
Illuminate\Support\Collection Object ([items:protected] => Array ([2] => john))
Illuminate\Support\Collection Object ([items:protected] => Array ([3] => dinesh))
Illuminate\Support\Collection Object ([items:protected] => Array ([4] => mahesh))
Illuminate\Support\Collection Object ([items:protected] => Array ())
$type1=DB::table('users')->where('name','=',$head)->pluck('name','id');
Я попытался объединить и сохранить его в $ type0;
$type0=$type0->merge($type1);
Это возвращают неверное значение
Illuminate\Support\Collection Object ([items:protected] => Array ([0] => rinu [1] => john))
Illuminate\Support\Collection Object ([items:protected] => Array ([0] => rinu [1] => john [2] => dinesh))
Illuminate\Support\Collection Object ([items:protected] => Array ([0] => rinu [1] => john [2] => dinesh [3] => mahesh))
Illuminate\Support\Collection Object ([items:protected] => Array ([0] => rinu [1] => john [2] => dinesh [3] => mahesh))`
enter code here
пойманы FATALERROREXCEPTION В 7BB347C8C194579700A647DADD62EA3D8E0AB68A.PHP ЛИНИИ 358: ВЫЗОВА к члену FUNCTION ToArray() на ARRAY – user3386779