Hopefully simple collection question

Posted 1 year ago by bart

Hey everyone,

I try to merge two collections in the way, that I would like to take one item from collection A, one from collection B, another from collection A etc.

I could achieve this by some custom loops but before I do this I'd like to ask if there is a more Laravel-like way.


Collection A: 1, 2, 3, 4, 5

Collection B: 6,7,8

Expected Result: 1,6,2,7,3,8,4,5

Thanks a lot!

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.