public function intersect(Collection $collection)
    {
        $array1 = $this->items;
        $array2 = $collection->toArray();

        $this->items = array_uintersect($array1, $array2, function($val1, $val2) {
            return strcmp($val1['slug'], $val2['slug']);
        });

        return $this;
    }
public function intersect(Collection $collection)
    {
        $array1 = $this->items;
        $array2 = $collection->toArray();

        $this->items = array_uintersect($array1, $array2, function($val1, $val2) {
            return strcmp($val1['slug'], $val2['slug']);
        });

        return $this;
    }
public function intersect ( Collection $ collection ) { $ array1 = $ this -> items ; $ array2 = $ collection -> toArray ( ) ; $ this -> items = array_uintersect ( $ array1 , $ array2 , function ( $ val1 , $ val2 ) { return strcmp ( $ val1 [ 'slug' ] , $ val2 [ 'slug' ] ) ; } ) ; return $ this ; }
Intersect another collection with the current collection

@param Collection $collection
@return $this
Intersect another collection with the current collection