Beispiel #1
0
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $this->checkSettings($request);
     $forceLocale = SettingsFacade::getLocale();
     if ($request->has(AppConfig::KEY_FORCE_LOCALE)) {
         $forceLocale = $request->input(AppConfig::KEY_FORCE_LOCALE);
     }
     setCurrentLocale($forceLocale);
     return $next($request);
 }
Beispiel #2
0
 protected function registerExtScripts($is_auth = false)
 {
     $this->extJsQueue->add('global-vars', ['THEME_PATH' => $this->asset(), 'AJAX_REQUEST_TOKEN' => csrf_token(), 'SETTINGS_NUMBER_FORMAT' => SettingsFacade::getNumberFormat()], JsQueue::TYPE_VAR);
     $this->extJsQueue->add('global-app-script', libraryAsset('katniss.js'));
 }
Beispiel #3
0
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  * @return mixed
  */
 public function handle(Request $request, Closure $next)
 {
     $this->checkSettings($request);
     if ($request->has(AppConfig::KEY_REDIRECT_URL)) {
         session([AppConfig::KEY_REDIRECT_URL => $request->input(AppConfig::KEY_REDIRECT_URL)]);
     }
     $localeRedirect = $this->checkForceLocale($request);
     if ($localeRedirect !== false) {
         return $localeRedirect;
     }
     return SettingsFacade::storeCookie($next($request));
 }