@if ($notifications->isNotEmpty())
| Title |
Message |
Time |
Status |
Action |
@foreach ($notifications as $notification)
@php
$isUnread = $notification->read_at === null;
$actionUrl = $notification->data['action_url'] ?? null;
$message = trim(strip_tags($notification->data['message'] ?? ($notification->data['body'] ?? 'You have a new notification')));
@endphp
| {{ $notification->data['title'] ?? 'Notification' }} |
{{ $message }} |
{{ $notification->created_at->diffForHumans() }} |
{{ $isUnread ? 'Unread' : 'Read' }} |
@if ($actionUrl)
Open
@elseif ($isUnread)
@else
Read
@endif
|
@endforeach
{{ $notifications->links() }}
@else
No notifications found.
@endif