src/Base/EssentialTrait.php
public function only(array $values): self
    {
        return $this->filter(function ($value) use ($values) {
            return in_array($value, $values);
        });
    }
public function only(array $values): self
    {
        return $this->filter(function ($value) use ($values) {
            return in_array($value, $values);
        });
    }
public function only ( array $ values ) : self { return $ this -> filter ( function ( $ value ) use ( $ values ) { return in_array ( $ value , $ values ) ; } ) ; }
Returns the items of the collection that match the specified array.

@param array $values

@return self
Returns the items of the collection that match the specified array .