Answer the question
In order to leave comments, you need to log in
How to merge the contents of two collections?
There are two collections( $itemsByMart , $customProductsByMart ). Below is the screenshot of the code
return [
'$itemsByMart' => $itemsByMart,
'$customProductsByMart' => $customProductsByMart
];
{
"1": [
{...},
{...},
{...}
],
"2": [
{...}
],
"3": [
{...}
]
}
Answer the question
In order to leave comments, you need to log in
One new empty collection and two foreach - one for each existing one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question