@extends('layout.layout') @section('content')
@include('components.alert')

Notifications

{{ $unreadCount }} unread notification{{ $unreadCount === 1 ? '' : 's' }}

@if($unreadCount > 0)
@csrf
@endif
@foreach(['all' => 'All', 'unread' => 'Unread', 'read' => 'Read'] as $key => $label) {{ $label }} @endforeach
@forelse($notifications as $notification) @php $data = $notification->data ?? []; $title = $data['title'] ?? $data['subject'] ?? class_basename($notification->type); $message = $data['message'] ?? $data['body'] ?? 'You have a new notification.'; @endphp
{{ $title }} {{ $notification->created_at?->diffForHumans() }}

{{ $message }}

@if(! $notification->read_at)
@csrf
@endif
@empty
No notifications found.
@endforelse
{{ $notifications->links() }}
@endsection