@php $notifications_count = auth()->user()->unreadNotifications->count(); @endphp @php $unreadNotifications = auth()->user()->unreadNotifications->all(); @endphp
@forelse ($unreadNotifications as $index => $notification) @php $notification_data = (object)$notification->data; @endphp

{{ @$notification_data->user['username'] }} @if(isset($notification_data->type) && @$notification_data->type == 'message'){{ 'left a message' }}@else{{ 'said' }}@endif {{ @$notification_data->body }} in {{ @$notification_data->title }}

{{ \Carbon\Carbon::parse(@$notification->created_at)->format('F, jS h:i A') }}

Mark as Read
@empty
All Caught Up!
@endforelse