PHP Class Arcanedev\Localization\Bases\Middleware

Author: ARCANEDEV ([email protected])
Inheritance: extends Arcanedev\Support\Bases\Middleware
Exibir arquivo Open project: arcanedev/localization

Public Methods

Method Description
getCurrentLocale ( ) : string Get the current locale.
getDefaultLocale ( ) : string Get the default locale.
getSupportedLocales ( ) : Arcanedev\Localization\Entities\LocaleCollection Return an array of all supported Locales.

Protected Methods

Method Description
getLocalizedRedirect ( string $locale ) : Illuminate\Http\RedirectResponse | null Get the redirection response.
hideDefaultLocaleInURL ( ) : boolean Hide the default locale in URL ??
isDefaultLocaleHidden ( string | null $locale ) : boolean Check is default locale hidden.
makeRedirectResponse ( string $url, integer $code = 302 ) : Illuminate\Http\RedirectResponse Make a redirect response.

Method Details

getCurrentLocale() public method

Get the current locale.
public getCurrentLocale ( ) : string
return string

getDefaultLocale() public method

Get the default locale.
public getDefaultLocale ( ) : string
return string

getLocalizedRedirect() protected method

Get the redirection response.
protected getLocalizedRedirect ( string $locale ) : Illuminate\Http\RedirectResponse | null
$locale string
return Illuminate\Http\RedirectResponse | null

getSupportedLocales() public method

Return an array of all supported Locales.
public getSupportedLocales ( ) : Arcanedev\Localization\Entities\LocaleCollection
return Arcanedev\Localization\Entities\LocaleCollection

hideDefaultLocaleInURL() protected method

Hide the default locale in URL ??
protected hideDefaultLocaleInURL ( ) : boolean
return boolean

isDefaultLocaleHidden() protected method

Check is default locale hidden.
protected isDefaultLocaleHidden ( string | null $locale ) : boolean
$locale string | null
return boolean

makeRedirectResponse() protected method

Make a redirect response.
protected makeRedirectResponse ( string $url, integer $code = 302 ) : Illuminate\Http\RedirectResponse
$url string
$code integer
return Illuminate\Http\RedirectResponse