@extends('layouts.main_dashboard.app') @section('title', __('dashboard.All System Notifications')) @section('page_heading', __('dashboard.All System Notifications')) @section('page_subtitle', __('dashboard.System notifications subtitle')) @section('skip_page_hero', true) @section('content') @php $notificationItems = $notifications->getCollection(); $userNotificationsCount = $notificationItems->where('type', 'user')->count(); $systemNotificationsCount = $notificationItems->where('type', '!=', 'user')->count(); $latestNotification = $notificationItems->first(); $typeLabels = [ 'user' => __('dashboard.User Notifications'), 'system' => __('dashboard.Notifications'), 'general' => __('dashboard.General Notifications'), ]; @endphp

{{ __('dashboard.All System Notifications') }}

{{ __('dashboard.System notifications subtitle') }}

{{ __('dashboard.Add New Notification') }}

{{ __('dashboard.Total Notifications') }}

{{ number_format($notifications->total()) }}

{{ __('dashboard.Current Page Items') }}

{{ number_format($notificationItems->count()) }}

{{ __('dashboard.User Notifications') }}

{{ number_format($userNotificationsCount) }}

{{ __('dashboard.Notifications') }}: {{ number_format($systemNotificationsCount) }}

{{ __('dashboard.Latest Send Date') }}

{{ $latestNotification?->created_at?->format('Y-m-d') ?? '—' }}

{{ __('dashboard.Notifications') }}

{{ __('dashboard.Current Page') }}: {{ $notifications->currentPage() }}

@if($notificationItems->isEmpty())

{{ __('dashboard.No notifications found.') }}

@else
@foreach($notificationItems as $notification) @endforeach
{{ __('dashboard.Title') }} {{ __('dashboard.Notification Type') }} {{ __('dashboard.Recipient Count') }} {{ __('dashboard.Sent by') }} {{ __('dashboard.Created Date') }} {{ __('dashboard.Actions') }}

{{ $notification->title }}

{{ \Illuminate\Support\Str::limit($notification->body, 120) }}

{{ $typeLabels[$notification->type] ?? \Illuminate\Support\Str::headline($notification->type) }} {{ number_format($notification->users_count ?? 0) }} {{ trim(($notification->creator->first_name ?? '') . ' ' . ($notification->creator->last_name ?? '')) ?: '—' }} {{ $notification->created_at?->format('Y-m-d') ?? '—' }}
{{ __('dashboard.View') }} {{ __('dashboard.Edit') }}
@csrf @method('DELETE')
{{ $notifications->appends(request()->query())->links('pagination::simple-tailwind') }}
@endif
@endsection