I am trying to add an Eloquent collection to another Eloquent collection in Laravel 5.3.
This is what I have done so far:
$entries = Entry::all(); $posts = Post::all(); $entries->merge($posts);
I tried using merge() as shown in the above code, but it seems like I'm stuck with such a problem (as some of them have the same id with the same value):
The collection merges, eating several rows
Any ideas?
source share