Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel collection reverse

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

$reversed = $collection->reverse();

$reversed->all();

// [5, 4, 3, 2, 1]
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #collection #reverse
ADD COMMENT
Topic
Name
7+6 =