Answers for "concatinate data to existing collection laravel"

PHP
0

laravel collection concat

$collection = collect(['John Doe']);

$concatenated = $collection->concat(['Jane Doe'])->concat(['name' => 'Johnny Doe']);

$concatenated->all();

// ['John Doe', 'Jane Doe', 'Johnny Doe']
Posted by: Guest on July-24-2021

Code answers related to "concatinate data to existing collection laravel"

Browse Popular Code Answers by Language