@extends('layout.layout') @section('content')
Notifications
@csrf
@if ($notifications->isNotEmpty())
@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 @endforeach
Title Message Time Status Action
{{ $notification->data['title'] ?? 'Notification' }} {{ $message }} {{ $notification->created_at->diffForHumans() }} {{ $isUnread ? 'Unread' : 'Read' }} @if ($actionUrl) Open @elseif ($isUnread) @else Read @endif
{{ $notifications->links() }}
@else
No notifications found.
@endif
@push('scripts') @endpush @endsection