guest()) { if ($request->ajax() || $request->wantsJson()) { return response('Unauthorized.', 401); } else { return redirect()->guest('/'); } } if ($auth->user()->email != 'admin@geolook.com') { return abort(404); } return $next($request); } }