shouldRedirect()) { return $next($request); } if (!$this->initialized()) { return redirect()->route('initialize.index'); } return $next($request); } public function shouldRedirect() { return !in_array(request()->route()->getName(), $this->dontRedirect) && auth()->check(); } public function initialized() { return \App\Fee::get()->count() > 0; } }