Devise\Languages\LocaleDetector::current PHP Method

current() public method

Get the current locale. At first we try to use the cookie if one is set. If a cookie is not set then we attempt to deduce the locale in this order: url segment, http headers, and finally we fall back to the universal locale which is set in laravel's app.locale (defaults to en).
public current ( ) : string
return string
    public function current()
    {
        $locale = $this->cookie();
        if (!$locale) {
            $locale = $locale ?: $this->segment();
            $locale = $locale ?: $this->header();
            if (!$locale || $locale === '' || $locale === 'un') {
                $locale = $this->universal();
            }
            $this->update($locale);
        }
        return $locale;
    }