Laravel - Collections - Method Reverse

The reverse method reverses the order of the collection's items, preserving the original keys:

    
    $collection = collect(['a', 'b', 'c', 'd', 'e']);
    
    $reversed = $collection->reverse();
    
    $reversed->all();
    
    /*
        [
            4 => 'e',
            3 => 'd',
            2 => 'c',
            1 => 'b',
            0 => 'a',
        ]
    */