protected function prepareUrl($url)
    {
        if (Str::startsWith($url, '/')) {
            $url = substr($url, 1);
        }

        if (! Str::startsWith($url, 'http')) {
            $url = sprintf("%s/%s", $this->baseUrl(), $url);
        }

        return trim($url, '/');
    }
protected function prepareUrl($url)
    {
        if (Str::startsWith($url, '/')) {
            $url = substr($url, 1);
        }

        if (! Str::startsWith($url, 'http')) {
            $url = sprintf("%s/%s", $this->baseUrl(), $url);
        }

        return trim($url, '/');
    }
protected function prepareUrl ( $ url ) { if ( Str :: startsWith ( $ url , '/' ) ) { $ url = substr ( $ url , 1 ) ; } if ( ! Str :: startsWith ( $ url , 'http' ) ) { $ url = sprintf ( "%s/%s" , $ this -> baseUrl ( ) , $ url ) ; } return trim ( $ url , '/' ) ; }
Prepare the relative URL, given by the user.

@param  string $url
@return string
Prepare the relative URL given by the user .