Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel collection concat

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

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

$concatenated->all();

// ['John Doe', 'Jane Doe', 'Johnny Doe'] 
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #collection #concat
ADD COMMENT
Topic
Name
9+2 =