@include('provider.partials.sidebar')
@endif
{{ __('notifications') }}
@forelse($data['notifications'] as $notification)
@php
// Determine the description based on the authenticated user
$description = ($data['auth_user'] == $notification->from_user_id)
? $notification->from_description
: $notification->to_description;
// Determine icon and color based on notification source
$iconClass = 'isax-info-circle';
$bgClass = 'bg-soft-secondary text-secondary';
if (Str::contains(strtolower($notification->source), 'cancel')) {
$iconClass = 'isax-calendar-remove';
$bgClass = 'bg-soft-danger text-danger';
} elseif (Str::contains(strtolower($notification->source), 'new booking')) {
$iconClass = 'isax-calendar-circle';
$bgClass = 'bg-soft-secondary text-secondary';
} elseif (Str::contains(strtolower($notification->source), 'withdraw')) {
$iconClass = 'isax-dollar-circle';
$bgClass = 'bg-soft-pink text-pink';
} elseif (Str::contains(strtolower($notification->source), 'complete')) {
$iconClass = 'isax-calendar-tick';
$bgClass = 'bg-soft-success text-success';
}
$isUnread = ($notification->to_user_id == $data['auth_user'] && $notification->to_read_type == 0) ||
($notification->from_user_id == $data['auth_user'] && $notification->from_read_type == 0);
@endphp
@empty
@endforelse
@if ($data['notifications']->hasPages())
{{ $notification->source }}
{!! $description !!}
{{ \Carbon\Carbon::parse($notification->created_at)->diffForHumans() }}
{{__('no_notifications_found')}}
{{ __('showing_results', [
'first' => $data['notifications']->firstItem(),
'last' => $data['notifications']->lastItem(),
'total' => $data['notifications']->total()
]) }}
{{ $data['notifications']->links('pagination::bootstrap-4') }}