original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Intersect another collection with the current collection
  
  @param Collection $collection
  @return $this
docstring_tokens: Intersect another collection with the current collection