Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel collection union

$collection = collect([1 => ['a'], 2 => ['b']]);

$union = $collection->union([3 => ['c'], 1 => ['b']]);

$union->all();

// [1 => ['a'], 2 => ['b'], 3 => ['c']]
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #collection #union
ADD COMMENT
Topic
Name
1+1 =