1
Bear in mind that Eloquent collections don’t behave like normal Collections, ie. they use getKey to merge results, so Model::all()->merge(Model::all())->count() === Model::all()->count()
– eithed
be aware that The merge method will replace any first collection in the original second collection’s items if a string key with the same value exists in the supplied $items. If the first collection keys are numeric, the second collection will be added to the end of the new collection’s laravel.com/docs/8.x/collections#method-merge
I think removing duplicates is required.
– mercury
+ There are no comments
Add yours