@php // Pull active announcements once per request — cached for 60s so the // user dashboard hot-path isn't hammering the DB on every page hit. $rows = \Illuminate\Support\Facades\Cache::remember( 'announcements.active.v1', 60, fn() => \App\Models\Announcement::active()->get(), ); if ($rows->isEmpty()) { return; } @endphp {{-- One bar per tone: same-tone announcements chain together with separators so the colour scheme stays consistent across the strip. --}} @foreach ($rows->groupBy('tone') as $tone => $group) @php $palette = $group->first()->toneClasses(); // Stable token so localStorage dismissal can persist across reloads. $token = 'ann-' . $group->pluck('id')->join('-'); @endphp