original_string: public function loadMissing($relations)
      {
          if (is_string($relations)) {
              $relations = func_get_args();
          }
  
          foreach ($relations as $key => $value) {
              if (is_numeric($key)) {
                  $key = $value;
              }
  
              $segments = explode('.', explode(':', $key)[0]);
  
              if (Str::contains($key, ':')) {
                  $segments[count($segments) - 1] .= ':'.explode(':', $key)[1];
              }
  
              $path = [];
  
              foreach ($segments as $segment) {
                  $path[] = [$segment => $segment];
              }
  
              if (is_callable($value)) {
                  $path[count($segments) - 1][end($segments)] = $value;
              }
  
              $this->loadMissingRelation($this, $path);
          }
  
          return $this;
      }
code: public function loadMissing($relations)
      {
          if (is_string($relations)) {
              $relations = func_get_args();
          }
  
          foreach ($relations as $key => $value) {
              if (is_numeric($key)) {
                  $key = $value;
              }
  
              $segments = explode('.', explode(':', $key)[0]);
  
              if (Str::contains($key, ':')) {
                  $segments[count($segments) - 1] .= ':'.explode(':', $key)[1];
              }
  
              $path = [];
  
              foreach ($segments as $segment) {
                  $path[] = [$segment => $segment];
              }
  
              if (is_callable($value)) {
                  $path[count($segments) - 1][end($segments)] = $value;
              }
  
              $this->loadMissingRelation($this, $path);
          }
  
          return $this;
      }
code_tokens: public function loadMissing ( $ relations ) { if ( is_string ( $ relations ) ) { $ relations = func_get_args ( ) ; } foreach ( $ relations as $ key => $ value ) { if ( is_numeric ( $ key ) ) { $ key = $ value ; } $ segments = explode ( '.' , explode ( ':' , $ key ) [ 0 ] ) ; if ( Str :: contains ( $ key , ':' ) ) { $ segments [ count ( $ segments ) - 1 ] .= ':' . explode ( ':' , $ key ) [ 1 ] ; } $ path = [ ] ; foreach ( $ segments as $ segment ) { $ path [ ] = [ $ segment => $ segment ] ; } if ( is_callable ( $ value ) ) { $ path [ count ( $ segments ) - 1 ] [ end ( $ segments ) ] = $ value ; } $ this -> loadMissingRelation ( $ this , $ path ) ; } return $ this ; }
docstring: Load a set of relationships onto the collection if they are not already eager loaded.
  
  @param  array|string  $relations
  @return $this
docstring_tokens: Load a set of relationships onto the collection if they are not already eager loaded .