Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel collection first

collect([1, 2, 3, 4])->first(function ($value, $key) {
    return $value > 2;
});

// 3
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #collection
ADD COMMENT
Topic
Name
6+6 =