Laravel - Collections - Method Shuffle

The shuffle method randomly shuffles the items in the collection:

    
    $collection = collect([1, 2, 3, 4, 5]);
    
    $shuffled = $collection->shuffle();
    
    $shuffled->all();
    
    // [3, 2, 5, 1, 4] - (generated randomly)