You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason for this is that Eloquent collections, upon merging, removes models with duplicate primary keys. You could iterate through $words and do $words->push($word) to add an extra reference to each model manually.
Hello,
I've been using
Collection->merge()
to duplicate one collection object into himself in order to have each item two times in my Collection.This code was pretty simple :
But since Laravel 4.1, the merge method returns me the only one of the two collections like if it was a simple
$words + $clone
.Do you have any idea on how to revert back to a similar behaviour while keeping a collection ?
Thank you for your answer and apologize for bad English
The text was updated successfully, but these errors were encountered: