@php $adminNotifCount = \App\Models\Notification::where('user_id', auth('web')->id()) ->where('type', 'deal_accepted')->where('is_read', false)->count(); $adminNotifs = \App\Models\Notification::where('user_id', auth('web')->id()) ->where('type', 'deal_accepted')->latest()->limit(6)->get(); $adminName = auth('web')->user()->name ?? 'Admin'; $adminEmail = auth('web')->user()->email ?? ''; $adminAvatar = strtoupper(substr($adminName, 0, 1)); @endphp
{{-- Hamburger --}} {{-- Page info --}}
@yield('title', 'Dashboard')
{{-- Notifications --}}
{{-- --}}
Notifications
@if($adminNotifCount > 0) {{ $adminNotifCount }} New @endif
@forelse($adminNotifs as $notif)
{{ $notif->title }}
{{ Str::limit($notif->message, 70) }}
{{ $notif->created_at->diffForHumans() }}
@empty
No new notifications
@endforelse
{{-- Divider --}}
{{-- Profile --}}
{{ $adminAvatar }}
{{ $adminName }}
{{ $adminEmail }}
@csrf
{{-- Session alerts --}}
@if(session('success')) @endif @if(session('error')) @endif @if($errors->any()) @endif