@use('App\Models\Domain') @php /* | The domains controller passes only the paginated list, and this redesign | may not change it — so the header figures are resolved here. Six bounded | aggregates, no per-row work. | | "Verified" is not a stored column. It means the install is inside the | check-in window the server itself gave it (next_verification_at), which is | the only definition that cannot drift from what the API enforces. */ $total = Domain::count(); $verified = Domain::where('status', 'active') ->whereNotNull('last_verification_at') ->where('next_verification_at', '>=', now()) ->count(); $pending = Domain::whereNull('last_verification_at')->count(); $ips = Domain::whereNotNull('current_ip')->distinct()->count('current_ip'); $versions = Domain::whereNotNull('cms_version')->distinct()->count('cms_version'); // Installations whose licence is genuinely usable right now — expiry folded // in, so this cannot claim more than the licences page does. $licensed = Domain::whereHas('license', fn ($q) => $q ->where('status', 'active') ->where(fn ($w) => $w->whereNull('expires_at')->orWhere('expires_at', '>', now())) )->count(); $share = fn (int $n) => $total > 0 ? round($n / $total * 100).'% of installations' : 'Nothing registered yet'; @endphp
merge(['class' => 'grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-6']) }}>