src/UrlGenerator.php
protected function resolveBaseUrlFrom(?string $root): void
    {
        // Build base URL and prefix.
        $baseUrl = \ltrim(\str_replace(['https://', 'http://'], '', $root), '/');
        $base = \explode('/', $baseUrl, 2);

        if (\count($base) > 1) {
            $this->basePrefix = \array_pop($base);
        }

        $this->baseUrl = \array_shift($base);
    }
protected function resolveBaseUrlFrom(?string $root): void
    {
        // Build base URL and prefix.
        $baseUrl = \ltrim(\str_replace(['https://', 'http://'], '', $root), '/');
        $base = \explode('/', $baseUrl, 2);

        if (\count($base) > 1) {
            $this->basePrefix = \array_pop($base);
        }

        $this->baseUrl = \array_shift($base);
    }
Resolve base url from given path.

@param  string|null  $root

@return void