@extends('admin.layout.template') @section('title', 'Notifications') @section('content')
All Notifications
@can('notifications.destroy') @if($notifications->count())
@csrf @method('DELETE')
@endif @endcan
@forelse($notifications as $notification) @php $data = is_array($notification->data) ? $notification->data : json_decode($notification->data, true); $isUnread = is_null($notification->read_at); @endphp
{{ $data['title'] ?? 'System Notification' }}

{{ $data['message'] ?? '' }}

{{ $notification->created_at->diffForHumans() }}
@if($isUnread) @endif @can('notifications.destroy')
@csrf @method('DELETE')
@endcan
@empty
No notifications available
@endforelse
@endsection