setTheme($request); return $next($request); } /** * Set the theme for the current middleware * * @param \Illuminate\Http\Request $request */ public function setTheme(Request $request) { if ($request->is(self::$skip)) { return; } try { $theme = setting('general.theme', 'default'); } catch (\Exception $e) { Log::error($e->getMessage()); $theme = 'default'; } if (!empty($theme)) { Theme::set($theme); } } }