Skip to content

Losing the ability to pass seed to the shuffle() method in the collection helper #54607

@misbahansori

Description

@misbahansori

Laravel Version

^11.0

PHP Version

^8.1.0

Database Driver & Version

No response

Description

In the previous version of Laravel, we could pass a seed to the shuffle() method in the collection helper:
https://laravel.com/api/10.x/Illuminate/Support/Collection.html#method_shuffle

However, in version 11, this method doesn't accept any arguments.
https://laravel.com/api/11.x/Illuminate/Support/Collection.html#method_shuffle

Steps To Reproduce

collect([1, 2, 3, 4, 5])->shuffle(123);

Expected behavior

The result should be the same given the same seed.

Current behavior

The result is different every time the code is executed.

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