App\Services\Locale\CurrentLocale::getContentLocale PHP Method

getContentLocale() public static method

public static getContentLocale ( ) : string
return string
    public static function getContentLocale() : string
    {
        if (!static::isValidLocale(locale())) {
            return config('app.locales')[0];
        }
        return locale();
    }

Usage Example

Example #1
0
function content_locale() : string
{
    return \App\Services\Locale\CurrentLocale::getContentLocale();
}