diff --git a/app/view-composers.php b/app/view-composers.php index 8ca86171..3e78491a 100644 --- a/app/view-composers.php +++ b/app/view-composers.php @@ -7,7 +7,9 @@ ->groupBy('status') ->orderBy('status', 'desc'); - if ($incidents->get()->count() <= 1 || ($incidents->get()->count() > 1 && (int) $incidents->first()->status === 4)) { + $incidentCount = $incidents->count(); + + if ($incidentCount <= 1 || ($incidentCount > 1 && (int) $incidents->first()->status === 4)) { $status = 'success'; $message = 'All systems are functional.'; } else {