Request::root PHP Method

root() public static method

Get the root URL for the application.
public static root ( ) : string
return string
        public static function root()
        {
            return \Illuminate\Http\Request::root();
        }

Usage Example

function getLangSwitch()
{
    $local = App::getLocale();
    $host = Config::get('app.host');
    $fr = '/fr';
    $de = '/de';
    $en = '/en';
    if ($host == 'convergedmaturity.com' || $host == 'convergedmaturity.co.uk' || $host == 'certus.convergedmaturity.co.uk' || $host == 'dellconverged.app' || $host == 'itf.convergedmaturity.com' || $host == 'infoniqa.convergedmaturity.com') {
        $en = '';
    } elseif ($host == 'convergedmaturity.fr') {
        $fr = '';
    } elseif ($host == 'bereit-fuer-konvergente-infrastruktur.de' || $host == 'niteflite.bereit-fuer-konvergente-infrastruktur.de') {
        $de = '';
    }
    switch ($local) {
        case 'en':
            return "\n\t\t\t<li><a href=" . Request::root() . $fr . "><i class=\"flag fr\"></i> French</a></li>\n\t\t\t<li><a href=" . Request::root() . $de . "><i class=\"flag de\"></i> German</a></li>\n\t\t\t";
            break;
        case 'fr':
            return "\n\t\t\t<li><a href=" . Request::root() . $en . "><i class=\"flag\"></i> English</a></li>\n\t\t\t<li><a href=" . Request::root() . $de . "><i class=\"flag de\"></i> German</a></li>\n\t\t\t";
            break;
        case 'de':
            return "\n\t\t\t<li><a href=" . Request::root() . $en . "><i class=\"flag\"></i> English</a></li>\n\t\t\t<li><a href=" . Request::root() . $fr . "><i class=\"flag fr\"></i> French</a></li>\n\t\t\t";
            break;
    }
}
All Usage Examples Of Request::root