From 7b9f364f36fab54c9fadb5316445694e09ba1d3f Mon Sep 17 00:00:00 2001 From: Ashwin Chandran Date: Wed, 27 May 2026 20:52:21 +0200 Subject: [PATCH] Fix status page incident count to exclude resolved incidents --- src/Http/Controllers/StatusPage/StatusPageController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Http/Controllers/StatusPage/StatusPageController.php b/src/Http/Controllers/StatusPage/StatusPageController.php index 0b3aff9b..c9b34438 100644 --- a/src/Http/Controllers/StatusPage/StatusPageController.php +++ b/src/Http/Controllers/StatusPage/StatusPageController.php @@ -27,7 +27,7 @@ public function index(): View { return view('cachet::status-page.index', [ 'componentGroups' => ComponentGroup::query() - ->with(['components' => fn ($query) => $query->enabled()->orderBy('order')->withCount('incidents')]) + ->with(['components' => fn ($query) => $query->enabled()->orderBy('order')->withCount(['incidents' => fn ($q) => $q->unresolved()])]) ->visible(auth()->check()) ->orderBy('order') ->when(auth()->check(), fn (Builder $query) => $query->users(), fn ($query) => $query->guests()) @@ -36,7 +36,7 @@ public function index(): View ->enabled() ->whereNull('component_group_id') ->orderBy('order') - ->withCount('incidents') + ->withCount(['incidents' => fn ($query) => $query->unresolved()]) ->get(), 'schedules' => Schedule::query()->with(['updates', 'components'])->incomplete()->orderBy('scheduled_at')->get(),