count(); $expiringSoon = SslCertificate::where('status', 'active') ->where('expires_at', '<=', now()->addDays(30)) ->where('expires_at', '>', now()) ->count(); $expired = SslCertificate::where('status', 'expired') ->orWhere(function ($q) { $q->where('expires_at', '<', now()); }) ->count(); $failed = SslCertificate::where('status', 'failed')->count(); $withoutSsl = $totalDomains - $domainsWithSsl; return [ [ 'value' => $domainsWithSsl, 'label' => __('With SSL'), 'icon' => 'heroicon-m-shield-check', 'color' => 'success', ], [ 'value' => $withoutSsl, 'label' => __('Without SSL'), 'icon' => 'heroicon-m-shield-exclamation', 'color' => 'gray', ], [ 'value' => $expiringSoon, 'label' => __('Expiring Soon'), 'icon' => 'heroicon-m-clock', 'color' => $expiringSoon > 0 ? 'warning' : 'success', ], [ 'value' => $expired, 'label' => __('Expired'), 'icon' => 'heroicon-m-x-circle', 'color' => $expired > 0 ? 'danger' : 'success', ], [ 'value' => $failed, 'label' => __('Failed'), 'icon' => 'heroicon-m-exclamation-triangle', 'color' => $failed > 0 ? 'danger' : 'success', ], ]; } }