public function basePath($path = null)
    {
        if (isset($this->basePath)) {
            return $this->basePath.($path ? '/'.$path : $path);
        }

        if ($this->runningInConsole()) {
            $this->basePath = getcwd();
        } else {
            $this->basePath = realpath(getcwd().'/../');
        }

        return $this->basePath($path);
    }
public function basePath($path = null)
    {
        if (isset($this->basePath)) {
            return $this->basePath.($path ? '/'.$path : $path);
        }

        if ($this->runningInConsole()) {
            $this->basePath = getcwd();
        } else {
            $this->basePath = realpath(getcwd().'/../');
        }

        return $this->basePath($path);
    }
public function basePath ( $ path = null ) { if ( isset ( $ this -> basePath ) ) { return $ this -> basePath . ( $ path ? '/' . $ path : $ path ) ; } if ( $ this -> runningInConsole ( ) ) { $ this -> basePath = getcwd ( ) ; } else { $ this -> basePath = realpath ( getcwd ( ) . '/../' ) ; } return $ this -> basePath ( $ path ) ; }
Get the base path for the application.

@param  string|null  $path
@return string
Get the base path for the application .