Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel collection combine

$collection = collect(['name', 'age']);

$combined = $collection->combine(['George', 29]);

$combined->all();

// ['name' => 'George', 'age' => 29]
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #collection #combine
ADD COMMENT
Topic
Name
2+1 =