public function with($relation)
    {
        if (func_num_args() == 1) {
            $this->with = array_merge($this->with, is_array($relation) ? $relation : [$relation]);
        } else {
            $this->with = array_merge($this->with, func_get_args());
        }

        return $this;
    }
public function with($relation)
    {
        if (func_num_args() == 1) {
            $this->with = array_merge($this->with, is_array($relation) ? $relation : [$relation]);
        } else {
            $this->with = array_merge($this->with, func_get_args());
        }

        return $this;
    }
public function with ( $ relation ) { if ( func_num_args ( ) == 1 ) { $ this -> with = array_merge ( $ this -> with , is_array ( $ relation ) ? $ relation : [ $ relation ] ) ; } else { $ this -> with = array_merge ( $ this -> with , func_get_args ( ) ) ; } return $ this ; }
Adds relation to eager loads.

@param string|string[] $relation

@return static
Adds relation to eager loads .