@php $sidebarAlertQ = \App\Models\Alert::query()->forSidebarBadge(); if (app()->bound(\App\Services\BranchContext::class)) { app(\App\Services\BranchContext::class)->applyToQuery($sidebarAlertQ, 'branch_id'); } $sidebarAlertCount = $sidebarAlertQ->count(); $user = auth()->user(); @endphp