has('locale') AND array_key_exists(Session()->get('locale'), languages())) { App::setLocale(Session()->get('locale')); } else { // This is optional as Laravel will automatically set the fallback language if there is none specified App::setLocale(system_setting('base.locale')); } return $next($request); } }