Answers for "laravel collection prepend"

PHP
0

laravel collection prepend

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

$collection->prepend(0);

$collection->all();

// [0, 1, 2, 3, 4, 5]
Posted by: Guest on July-24-2021

Browse Popular Code Answers by Language