original_string: public function with($relations)
      {
          if (is_array($relations)) {
              if (Arr::isAssoc($relations)) {
                  $relations = array_keys($relations);
              }
  
              $this->eagerLoads = array_merge($this->eagerLoads, $relations);
          }
  
          if (is_string($relations)) {
              if (Str::contains($relations, '.')) {
                  $relations = explode('.', $relations)[0];
              }
  
              if (Str::contains($relations, ':')) {
                  $relations = explode(':', $relations)[0];
              }
  
              if (in_array($relations, $this->eagerLoads)) {
                  return $this;
              }
  
              $this->eagerLoads[] = $relations;
          }
  
          return $this->__call('with', (array) $relations);
      }
code: public function with($relations)
      {
          if (is_array($relations)) {
              if (Arr::isAssoc($relations)) {
                  $relations = array_keys($relations);
              }
  
              $this->eagerLoads = array_merge($this->eagerLoads, $relations);
          }
  
          if (is_string($relations)) {
              if (Str::contains($relations, '.')) {
                  $relations = explode('.', $relations)[0];
              }
  
              if (Str::contains($relations, ':')) {
                  $relations = explode(':', $relations)[0];
              }
  
              if (in_array($relations, $this->eagerLoads)) {
                  return $this;
              }
  
              $this->eagerLoads[] = $relations;
          }
  
          return $this->__call('with', (array) $relations);
      }
code_tokens: public function with ( $ relations ) { if ( is_array ( $ relations ) ) { if ( Arr :: isAssoc ( $ relations ) ) { $ relations = array_keys ( $ relations ) ; } $ this -> eagerLoads = array_merge ( $ this -> eagerLoads , $ relations ) ; } if ( is_string ( $ relations ) ) { if ( Str :: contains ( $ relations , '.' ) ) { $ relations = explode ( '.' , $ relations ) [ 0 ] ; } if ( Str :: contains ( $ relations , ':' ) ) { $ relations = explode ( ':' , $ relations ) [ 0 ] ; } if ( in_array ( $ relations , $ this -> eagerLoads ) ) { return $ this ; } $ this -> eagerLoads [ ] = $ relations ; } return $ this -> __call ( 'with' , ( array ) $ relations ) ; }
docstring: Set the relationships that should be eager loaded.
  
  @param mixed $relations
  
  @return $this|Model
docstring_tokens: Set the relationships that should be eager loaded .