@extends('frontend.theme_2.app') @section('title', __('Notifications') . ' || ' . $companyName) @section('content')
@include('frontend.pages.customer.sidemenu')

{{ __('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
{{ $notification->source }}

{!! $description !!}

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

@empty
{{__('No notifications found.')}}
@endforelse
@if ($data['notifications']->hasPages())
{{ __('showing') }} {{ $data['notifications']->firstItem() }} {{ __('to') }} {{ $data['notifications']->lastItem() }} {{ __('of') }} {{ $data['notifications']->total() }} {{ __('results') }}
{{ $data['notifications']->links('pagination::bootstrap-4') }}
@endif
@endsection @push('scripts') @endpush