i am new in laravel. i want to merge 2 multidimansional array in one array. i am using array_merge function but isn't work. i want merge array[0] position values and array[1] position values.
here is my current array look like this
Array
(
[0] => Illuminate\Support\Collection Object
(
[items:protected] => Array
(
[0] => stdClass Object
(
[product_id] => 2
[sale_datetime] => 2018-10-15 16:33:59
[name] => Tea
[totalqty] => 3
)
[1] => stdClass Object
(
[product_id] => 2
[sale_datetime] => 2018-10-16 10:44:14
[name] => Tea
[totalqty] => 5
)
)
)
[1] => Illuminate\Support\Collection Object
(
[items:protected] => Array
(
[0] => stdClass Object
(
[product_id] => 3
[sale_datetime] => 2018-11-15 18:04:36
[name] => Coffee
[totalqty] => 20
)
)
)
)
and i want to make array like below array
Array
(
[0] => Illuminate\Support\Collection Object
(
[items:protected] => Array
(
[0] => stdClass Object
(
[product_id] => 2
[sale_datetime] => 2018-10-15 16:33:59
[name] => Tea
[totalqty] => 3
)
[1] => stdClass Object
(
[product_id] => 2
[sale_datetime] => 2018-10-16 10:44:14
[name] => Tea
[totalqty] => 5
)
[2] => stdClass Object
(
[product_id] => 3
[sale_datetime] => 2018-11-15 18:04:36
[name] => Coffee
[totalqty] => 20
)
)
)
)