Answers for "laravel collection collapse"

PHP
0

laravel collection collapse

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

$collapsed = $collection->collapse();

$collapsed->all();

// [1, 2, 3, 4, 5, 6, 7, 8, 9]
Posted by: Guest on July-24-2021

Browse Popular Code Answers by Language