Skip to content

Collection merge behavior changed #3445

Closed
@RomainSauvaire

Description

@RomainSauvaire

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 :

// Duplicate the collections
$words = Word::where('id', '<', '10');
$clone = clone $words;
$doubleWords = $words->merge($clone);

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions