Answers for "laravel collection shuffle"

PHP
0

laravel collection shuffle

$collection = collect([1, 2, 3, 4, 5]);

$shuffled = $collection->shuffle();

$shuffled->all();

// [3, 2, 5, 1, 4] - (generated randomly)
Posted by: Guest on July-24-2021

Code answers related to "laravel collection shuffle"

Browse Popular Code Answers by Language