public static function setLanguage($language)
    {
        if (! ($language instanceof Language)) {
            $language = Language::findByCode($language);
        }

        if (! $language) {
            return false;
        }

        App::setLocale($language->code);
        request()->setDefaultLocale($language->code);
        self::$language = $language;

        return $language;
    }
public static function setLanguage($language)
    {
        if (! ($language instanceof Language)) {
            $language = Language::findByCode($language);
        }

        if (! $language) {
            return false;
        }

        App::setLocale($language->code);
        request()->setDefaultLocale($language->code);
        self::$language = $language;

        return $language;
    }
public static function setLanguage ( $ language ) { if ( ! ( $ language instanceof Language ) ) { $ language = Language :: findByCode ( $ language ) ; } if ( ! $ language ) { return false ; } App :: setLocale ( $ language -> code ) ; request ( ) -> setDefaultLocale ( $ language -> code ) ; self :: $ language = $ language ; return $ language ; }
Set application Language instance
@return Language
Set application Language instance