intersect() public method

Intersect the collection with the given items.
public intersect ( mixed $items ) : static
$items mixed
return static
Example #1
0
 public function testIntersectCollection()
 {
     $c = new Collection(['id' => 1, 'first_word' => 'Hello']);
     $this->assertEquals(['first_word' => 'Hello'], $c->intersect(new Collection(['first_world' => 'Hello', 'last_word' => 'World']))->all());
 }