@extends('frontend.provider.app') @section('title', __('manage_notification')) @section('content')
@include('provider.partials.sidebar')

@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
{{ $notification->source }}

{!! $description !!}

{{ \Carbon\Carbon::parse($notification->created_at)->diffForHumans() }}

@empty

{{__('no_notifications_found')}}

@endforelse
@if ($data['notifications']->hasPages())
{{ __('showing_results', [ 'first' => $data['notifications']->firstItem(), 'last' => $data['notifications']->lastItem(), 'total' => $data['notifications']->total() ]) }}
{{ $data['notifications']->links('pagination::bootstrap-4') }}
@endif
@endsection @push('scripts') @endpush