public function setLanguage($language)
    {
        if (Switcher::getRedirect() == 'route') {
            return redirect(Switcher::getRedirectRoute())->withCookie(Switcher::setLanguage($language));
        }
        if (Switcher::getRedirect() == 'locale') {
            return redirect(Switcher::getLocalBack($language))->withCookie(Switcher::setLanguage($language));
        }
        return back()->withCookie(Switcher::setLanguage($language));
    }
public function setLanguage($language)
    {
        if (Switcher::getRedirect() == 'route') {
            return redirect(Switcher::getRedirectRoute())->withCookie(Switcher::setLanguage($language));
        }
        if (Switcher::getRedirect() == 'locale') {
            return redirect(Switcher::getLocalBack($language))->withCookie(Switcher::setLanguage($language));
        }
        return back()->withCookie(Switcher::setLanguage($language));
    }
public function setLanguage ( $ language ) { if ( Switcher :: getRedirect ( ) == 'route' ) { return redirect ( Switcher :: getRedirectRoute ( ) ) -> withCookie ( Switcher :: setLanguage ( $ language ) ) ; } if ( Switcher :: getRedirect ( ) == 'locale' ) { return redirect ( Switcher :: getLocalBack ( $ language ) ) -> withCookie ( Switcher :: setLanguage ( $ language ) ) ; } return back ( ) -> withCookie ( Switcher :: setLanguage ( $ language ) ) ; }
Set the language and redirect
@param $language
@return mixed
Set the language and redirect