protected function tryGuessScheme(?string $domain) : ?string
    {
        if ($domain !== null) {
            if (Str::startsWith($domain, 'https')) {
                return 'https://';
            }

            if (Str::startsWith($domain, 'http')) {
                return 'http://';
            }
        }

        return (isset($_SERVER['HTTPS'])
            && !empty($_SERVER['HTTPS'])
            && strtolower($_SERVER['HTTPS']) !== 'off')
            ? 'https://' : 'http://';
    }
protected function tryGuessScheme(?string $domain) : ?string
    {
        if ($domain !== null) {
            if (Str::startsWith($domain, 'https')) {
                return 'https://';
            }

            if (Str::startsWith($domain, 'http')) {
                return 'http://';
            }
        }

        return (isset($_SERVER['HTTPS'])
            && !empty($_SERVER['HTTPS'])
            && strtolower($_SERVER['HTTPS']) !== 'off')
            ? 'https://' : 'http://';
    }
protected function tryGuessScheme ( ? string $ domain ) : ? string { if ( $ domain !== null ) { if ( Str :: startsWith ( $ domain , 'https' ) ) { return 'https://' ; } if ( Str :: startsWith ( $ domain , 'http' ) ) { return 'http://' ; } } return ( isset ( $ _SERVER [ 'HTTPS' ] ) && ! empty ( $ _SERVER [ 'HTTPS' ] ) && strtolower ( $ _SERVER [ 'HTTPS' ] ) !== 'off' ) ? 'https://' : 'http://' ; }
Get the scheme from the domain

@param null|string $domain
@return null|string
Get the scheme from the domain