Skip to content

Conversation

@NathanaelGT
Copy link
Contributor

Follow up #43219

This PR adds preserveKeys parameter to Collection->random()

before:

Arr::random($collection->all(), 2, true);

after:

$collection->random(2, true);

@taylorotwell taylorotwell merged commit d52ef24 into laravel:master Jul 19, 2022
@NathanaelGT NathanaelGT deleted the master branch July 19, 2022 16:55
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.

2 participants