Support the ongoing development of →
posted 9 years ago
Last updated 1 year ago.

You could look at PHP's array_merge or array_combine (after you have converted the results to arrays) and then convert the output to a Collection if you needed it.

Or better still, I'd probably look at running a raw DB query to get the data you wanted. It sounds to me like the standard Eloquent result sets won't cut it in this case.

If someone else has a solution to merge collections, that might be better. I've not heard of one yet though.

Hope it helps.

Last updated 1 year ago.

you could try to use merger method.


Sign in to participate in this thread!


Your banner here too?

divdax divdax Joined 3 Feb 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 - All rights reserved.