union() public method

Union the collection with the given items.
public union ( mixed $items ) : static
$items mixed
return static
Example #1
0
 public function testUnionCollection()
 {
     $c = new Collection(['name' => 'Hello']);
     $this->assertEquals(['name' => 'Hello', 'id' => 1], $c->union(new Collection(['name' => 'World', 'id' => 1]))->all());
 }