@extends('layouts.front.home') @section('title') {{ __('nav.notifications') }} - {{ __('nav.dashboard') }} @endsection @section('css') @endsection @section('content')
@include('flash::message') @php $currentFilter = $filter ?? request('filter', 'all'); $allNotificationsUrl = route('user/notifications', [0, PAGINATION_COUNT]); $resetNotificationsUrl = request()->url(); $allTabUrl = $allNotificationsUrl; $readTabUrl = request()->url() . '?filter=read'; $unreadTabUrl = request()->url() . '?filter=unread'; @endphp

{{ __('nav.notifications') }}

{{ __('nav.notifications_description') }}

{{ __('nav.dashboard') }}
{{ __('nav.all') }} {{ $totalNotifications }}
{{ __('nav.unread') }} {{ $unreadNotifications }}
{{ __('nav.read') }} {{ max($totalNotifications - $unreadNotifications, 0) }}

{{ __('nav.recent_notifications') }}

{{ __('nav.notifications_description') }}

@if($unreadNotifications > 0)
@csrf
@endif @if($currentFilter !== 'all') {{ __('nav.reset') }} @endif

{{ __('nav.notification') }}

{{ __('nav.notifications_description') }}

@if($notifications->count())
@foreach($notifications as $notification) @php $isUnread = is_null($notification->read_at); $title = $notification->display_title ?? ($notification->title ?: __('nav.notification')); $message = $notification->display_message ?? ($notification->content ?: ($notification->message ?: '')); $actionUrl = $notification->display_url ?? $notification->action_url; $timestamp = $notification->created_at; $timeLabel = $timestamp ? $timestamp->diffForHumans() : ''; @endphp

{{ $title }}

{{ $isUnread ? __('nav.unread') : __('nav.read') }}
@if($message)

{{ $message }}

@endif
{{ $timeLabel }} @if($notification->created_at) {{ $timestamp->format('Y-m-d H:i') }} @endif
{{ $timeLabel }}
@if($actionUrl) {{ __('nav.view') }} @endif @if($isUnread)
@csrf
@endif
@csrf @method('DELETE')
@endforeach
@if($notifications->hasPages())
{{ $notifications->links('pagination::bootstrap-5') }}
@endif @else

{{ __('nav.no_notifications') }}

{{ __('nav.notifications_description') }}

@endif
@endsection @section('script') @endsection