src/PathGenerator.php
public function http(string $item = null): string
    {
        $base = $this->request->getBaseUri();
        empty($base) || $base = $base . '/';

        $base = '/' . ltrim($base, '/');

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

        $host = $this->request->getHttp();
        $path = '';

        $_host = $this->config->item('paths.host');

        !empty($_host) || $_host = $this->request->getHost();

        switch ($item) {
            case 'host':
                $host .= rtrim($_host, '/') . '/';
                break;
            case 'base':
                $host .= rtrim($_host, '/') . $base;
                break;
            default:
                $path = path($item, false);
                break;
        }

        return $host . $path;
    }
public function http(string $item = null): string
    {
        $base = $this->request->getBaseUri();
        empty($base) || $base = $base . '/';

        $base = '/' . ltrim($base, '/');

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

        $host = $this->request->getHttp();
        $path = '';

        $_host = $this->config->item('paths.host');

        !empty($_host) || $_host = $this->request->getHost();

        switch ($item) {
            case 'host':
                $host .= rtrim($_host, '/') . '/';
                break;
            case 'base':
                $host .= rtrim($_host, '/') . $base;
                break;
            default:
                $path = path($item, false);
                break;
        }

        return $host . $path;
    }
@param null|string $item

@return string