Skip to content

[5.6] Add ability to seed Arr::shuffle() - #23490

Merged
taylorotwell merged 2 commits into
laravel:5.6from
timacdonald:allow_seed_arr_shuffle
Mar 12, 2018
Merged

[5.6] Add ability to seed Arr::shuffle()#23490
taylorotwell merged 2 commits into
laravel:5.6from
timacdonald:allow_seed_arr_shuffle

Conversation

@timacdonald

Copy link
Copy Markdown
Member

Ability to seed the array shuffle method. This is already available in Collection, but I've moved the functionality to Arr so it is accessible there also.

$seedShuffled = Arr::shuffle($array, date('H'))

Comment thread src/Illuminate/Support/Arr.php Outdated
* Shuffle the given array and return the result.
*
* @param array $array
* @param int $seed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int|null

@taylorotwell
taylorotwell merged commit 91ee51f into laravel:5.6 Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants