@extends('web_site.account.layout') @php $locale = app()->getLocale(); // Group this page's notifications by day: Today, Yesterday, then the date. $groups = $notifications->getCollection()->groupBy(function ($notification) { $day = $notification->created_at; return $day?->isToday() ? trans('site.notifications.today') : ($day?->isYesterday() ? trans('site.notifications.yesterday') : $day?->translatedFormat('j F Y')); }); @endphp @section('account_title', trans('site.notifications.title')) @section('account_content')
@if ($notifications->where('read_at', null)->isNotEmpty())
@csrf
@endif
@forelse ($groups as $label => $items)

{{ $label }}

@foreach ($items as $notification) {{ data_get($notification->data, "title_$locale") ?? data_get($notification->data, 'title') }} {{ data_get($notification->data, "message_$locale") ?? data_get($notification->data, 'message') }} {{ $notification->created_at?->translatedFormat('h:i A') }} @endforeach @empty

{{ trans('site.notifications.empty') }}

@endforelse
{{ $notifications->links() }}
@endsection