@php // Global "update available" cue for the Version nav item — a cache read only (no network). $updateAvailable = app(\App\Services\ReleaseChecker::class)->updateAvailable(); // Honeypot fake-login attempts in the last 24h → Threats nav badge. The sidebar renders on // every page, so cache the count for 60s to avoid a per-render COUNT query. $threatCount = \Illuminate\Support\Facades\Cache::remember( 'threats:login_attempts_24h', 60, fn () => \App\Models\AuditEvent::where('action', 'security.honeypot_login') ->where('created_at', '>', now()->subDay()) ->count(), ); // Active (firing) alert incidents → the Alarme nav badge. Cached like the threats count. $alertCount = \Illuminate\Support\Facades\Cache::remember( 'alerts:firing_count', 60, fn () => \App\Models\AlertIncident::where('state', 'firing')->count(), ); @endphp {{-- Fixed on desktop, off-canvas drawer on mobile/tablet (toggled by `nav` in the layout). --}}