public static function setCurrent(string $languageSlug)
    {
        $languageData  = self::findBySlug($languageSlug);
        if ($languageData) {
            App::setLocale($languageSlug);
            Carbon::setLocale($languageSlug);
            self::$current = $languageData;
        } else {
            self::$current = self::$default;
            \Request::route()->setParameter('lang', self::$current->slug);
        }
    }
public static function setCurrent(string $languageSlug)
    {
        $languageData  = self::findBySlug($languageSlug);
        if ($languageData) {
            App::setLocale($languageSlug);
            Carbon::setLocale($languageSlug);
            self::$current = $languageData;
        } else {
            self::$current = self::$default;
            \Request::route()->setParameter('lang', self::$current->slug);
        }
    }
public static function setCurrent ( string $ languageSlug ) { $ languageData = self :: findBySlug ( $ languageSlug ) ; if ( $ languageData ) { App :: setLocale ( $ languageSlug ) ; Carbon :: setLocale ( $ languageSlug ) ; self :: $ current = $ languageData ; } else { self :: $ current = self :: $ default ; \ Request :: route ( ) -> setParameter ( 'lang' , self :: $ current -> slug ) ; } }
Set current language across all the environment.

@param  string $languageSlug
@throws \Exception
Set current language across all the environment .