src/PathGenerator.php
public function path(string $item = null, bool $fromRoot = true): string
    {
        $system = rtrim($this->config->item('paths.system'), '/') . '/';

        if (is_null($item)) {
            return $system;
        }

        $path = '';

        switch ($item) {
            case 'app':
                $path = rtrim($this->config->item('paths.app'), '/') . '/';
                break;
            case 'modules':
                $path = rtrim($this->config->item('paths.modules'), '/') . '/';
                break;
            case 'resources':
                $path = rtrim($this->config->item('paths.resources'),
                        '/') . '/';
                break;
            case 'views':
                $path = rtrim($this->config->item('paths.views'), '/') . '/';
                break;
            case 'storage':
                $path = rtrim($this->config->item('paths.storage'), '/') . '/';
                break;
            case 'translations':
                $path = $this->config->item('paths.translations');
                break;
            default:
                $path = $this->config->item('paths.' . $item);
                break;
        }

        ! $fromRoot || $path = $system . $path;

        return $path;
    }
public function path(string $item = null, bool $fromRoot = true): string
    {
        $system = rtrim($this->config->item('paths.system'), '/') . '/';

        if (is_null($item)) {
            return $system;
        }

        $path = '';

        switch ($item) {
            case 'app':
                $path = rtrim($this->config->item('paths.app'), '/') . '/';
                break;
            case 'modules':
                $path = rtrim($this->config->item('paths.modules'), '/') . '/';
                break;
            case 'resources':
                $path = rtrim($this->config->item('paths.resources'),
                        '/') . '/';
                break;
            case 'views':
                $path = rtrim($this->config->item('paths.views'), '/') . '/';
                break;
            case 'storage':
                $path = rtrim($this->config->item('paths.storage'), '/') . '/';
                break;
            case 'translations':
                $path = $this->config->item('paths.translations');
                break;
            default:
                $path = $this->config->item('paths.' . $item);
                break;
        }

        ! $fromRoot || $path = $system . $path;

        return $path;
    }
public function path ( string $ item = null , bool $ fromRoot = true ) : string { $ system = rtrim ( $ this -> config -> item ( 'paths.system' ) , '/' ) . '/' ; if ( is_null ( $ item ) ) { return $ system ; } $ path = '' ; switch ( $ item ) { case 'app' : $ path = rtrim ( $ this -> config -> item ( 'paths.app' ) , '/' ) . '/' ; break ; case 'modules' : $ path = rtrim ( $ this -> config -> item ( 'paths.modules' ) , '/' ) . '/' ; break ; case 'resources' : $ path = rtrim ( $ this -> config -> item ( 'paths.resources' ) , '/' ) . '/' ; break ; case 'views' : $ path = rtrim ( $ this -> config -> item ( 'paths.views' ) , '/' ) . '/' ; break ; case 'storage' : $ path = rtrim ( $ this -> config -> item ( 'paths.storage' ) , '/' ) . '/' ; break ; case 'translations' : $ path = $ this -> config -> item ( 'paths.translations' ) ; break ; default : $ path = $ this -> config -> item ( 'paths.' . $ item ) ; break ; } ! $ fromRoot || $ path = $ system . $ path ; return $ path ; }
@param string|null $item
@param bool        $fromRoot

@return string
@param string|null $item @param bool $fromRoot