@php $notifications = $notifications ?? collect(); $notifications = auth()->user()->notifications; // All notifications $unreadCount = auth()->user()->unreadNotifications->count();// if not passed, use an empty collection @endphp @if($notifications->isNotEmpty()) {{-- show notifications --}} @endif