ip()) ->where('ban_expire', '>', time()) ->whereIn('type', ['ip', 'machine']) ->orderByDesc('id') ->exists(); if ($request->is('logout')) { $response = $next($request); assert($response instanceof Response); return $response; } if (! $authenticated && ! $ipBan && $request->is('banned')) { return to_route('login'); } if ($ipBan && ! $request->is('banned')) { return to_route('banned.show'); } if ($authenticated) { $accountBan = $request->user()?->ban; if ($accountBan && ! $request->is('banned')) { return to_route('banned.show'); } if (! $ipBan && ! $accountBan && $request->is('banned')) { return to_route('me.show'); } } $response = $next($request); assert($response instanceof Response); return $response; } }