@php $notifications = auth()->user()->notifications()->latest()->limit(10)->get(); @endphp
@forelse($notifications as $notification)
{{ $notification->created_at->diffForHumans() }}
{{ $notification->data['message'] ?? 'You have a new notification' }}
@if(isset($notification->data['context_url'])) View @endif
@empty

No notifications

@endforelse
View All {{ auth()->user()->unreadNotifications()->count() }} unread