Answers for "laravel collection partition"

PHP
0

laravel collection partition

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

list($underThree, $aboveThree) = $collection->partition(function ($i) {
    return $i < 3;
});
Posted by: Guest on July-24-2021

Code answers related to "laravel collection partition"

Browse Popular Code Answers by Language