user()?->tokenCan('*')) { return $next($request); } abort_if($request->ajax() || $request->wantsJson(), Response::HTTP_UNAUTHORIZED); return redirect()->guest('/'); } }