Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] Allow the shuffle() method to be seeded #14099

Merged
merged 1 commit into from
Jun 22, 2016
Merged

[5.2] Allow the shuffle() method to be seeded #14099

merged 1 commit into from
Jun 22, 2016

Conversation

JayBizzle
Copy link
Contributor

We often need to display items in a random order, but only random on a daily basis i.e. the order is static for a day, then the following day, the order changes.

This PR adds the ability to seed the shuffle() method.

@GrahamCampbell
Copy link
Member

Why not just use the random_int function. It has better performance than mt_rand.

@JayBizzle
Copy link
Contributor Author

random_int isn't seedable is it?

@taylorotwell taylorotwell merged commit f21e34b into laravel:5.2 Jun 22, 2016
@JayBizzle JayBizzle deleted the shuffle_seed branch June 22, 2016 12:34
@GrahamCampbell
Copy link
Member

random_int isn't seedable is it?

Why is that needed?

@GrahamCampbell
Copy link
Member

Oh, sorry. I get what you're doing now! Looks fine. :)

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