@use('App\Models\Booking') @use('app\Helpers\Helpers') @use('App\Enums\BookingEnum') @use('App\Enums\BookingEnumSlug') @use('App\Enums\RoleEnum') @use('App\Enums\SymbolPositionEnum') @php $role = Helpers::getRoleByUserId(request()->id); $bookingCounts = []; foreach ( [ BookingEnum::PENDING => 'box', BookingEnum::ON_GOING => 'calendar', BookingEnum::ON_THE_WAY => 'package', BookingEnum::COMPLETED => 'truck', BookingEnum::CANCEL => 'x-circle', BookingEnum::ON_HOLD => 'alert-circle', ] as $status => $icon ) { $bookingCounts[] = Booking::getBookingStatusById($user?->servicemen_bookings, $user->id, $status); } @endphp @extends('backend.layouts.master') @section('title', __('static.user_dashboard.general_info')) @section('content')
@if ($user?->getFirstMediaUrl('image')) header-user @else
{{ substr($user?->name, 0, 1) }}
@endif

{{ $user?->name }}

  • {{ __('static.user_dashboard.email') }} : {{ $user?->email }}
  • {{ __('static.user_dashboard.phone') }} : +{{ $user?->code }} {{ $user?->phone }}
  • {{ __('static.user_dashboard.country') }} : {{ $user?->primary_address?->country?->name }}
  • {{ __('static.user_dashboard.state') }} : {{ $user?->primary_address?->state?->name }}
  • {{ __('static.user_dashboard.city') }} : {{ $user?->primary_address?->city }}
  • {{ __('static.user_dashboard.address') }} : {{ $user?->primary_address?->address }}

{{ __('static.user_dashboard.bookings') }}

@forelse ($user?->servicemen_bookings->paginate(4) as $booking) @empty

{{ __('static.dashboard.data_not_found') }}

@endforelse
{{ __('static.user_dashboard.booking_number') }} {{ __('static.user_dashboard.service_name') }} {{ __('static.user_dashboard.provider_name') }} {{ __('static.user_dashboard.created') }} {{ __('static.user_dashboard.status') }}
#{{ $booking?->booking_number }}
{{ $booking?->service->title }}
@if (Helpers::getDefaultCurrency()->symbol_position === SymbolPositionEnum::LEFT)
{{ Helpers::getDefaultCurrencySymbol() }}{{ number_format($booking?->service->price, 2) }}
@else
{{ number_format($booking?->service->price, 2) }} {{ Helpers::getDefaultCurrencySymbol() }}
@endif
@php $media = $booking?->consumer?->getFirstMedia('image'); $imageUrl = $media ? $media->getUrl() : null; @endphp @if ($imageUrl) Image @else
{{ strtoupper(substr($booking?->consumer?->name, 0, 1)) }}
@endif
{{ $booking?->consumer?->name }}
{{ $booking?->consumer?->email }}
{{ date('d-M-Y', strtotime($booking->created_at)) }} @if (count($booking->sub_bookings)) {{ $booking->sub_bookings?->first()?->booking_status?->name }} @elseif (isset($booking->booking_status?->color_code)) {{ $booking->booking_status?->name }} @endif

{{ Helpers::getBookingsCountById($user->id) }}

{{ __('static.dashboard.bookings') }}
@if (Helpers::getDefaultCurrency()->symbol_position === SymbolPositionEnum::LEFT)

{{ Helpers::getDefaultCurrencySymbol() }}{{ Helpers::getBalanceById($user->id) }}

@else

{{ Helpers::getBalanceById($user->id) }} {{ Helpers::getDefaultCurrencySymbol() }}

@endif
{{ __('static.user_dashboard.wallet') }}

{{ __('static.dashboard.reviews') }}

@forelse ($user->servicemanreviews->paginate(4) as $review) @empty

{{ __('static.dashboard.data_not_found') }}

@endforelse
{{ __('static.user_dashboard.customer_name') }} {{ __('static.user_dashboard.service_name') }} {{ __('static.user_dashboard.ratings') }} {{ __('static.user_dashboard.description') }}
@php $media = $review?->consumer?->getFirstMedia('image'); $imageUrl = $media ? $media->getUrl() : null; @endphp @if ($imageUrl) Image @else
{{ strtoupper(substr($review?->consumer?->name, 0, 1)) }}
@endif
{{ $review?->consumer?->name }}
{{ $review?->consumer?->email }}
{{ $booking?->service->title }}
@if (Helpers::getDefaultCurrency()->symbol_position === SymbolPositionEnum::LEFT)
{{ Helpers::getDefaultCurrencySymbol() }}{{ number_format($booking?->service->price, 2) }}
@else
{{ number_format($booking?->service->price, 2) }} {{ Helpers::getDefaultCurrencySymbol() }}
@endif
{{ number_format($review?->rating, 2) }}

{{ $review?->description }}

{{ __('static.user_dashboard.withdraw_request') }}

@forelse ($user?->servicemanWithdrawRequest as $withdrawRequest) @empty

{{ __('static.dashboard.data_not_found') }}

@endforelse
{{ __('static.dashboard.amount') }} {{ __('static.user_dashboard.message') }} {{ __('static.user_dashboard.created') }} {{ __('static.user_dashboard.status') }}
{{ $withdrawRequest?->amount }} {{ $withdrawRequest?->message }} {{ $withdrawRequest?->created_at }} @php switch ($withdrawRequest->status) { case 'approved': $labelClass = 'success'; break; case 'pending': $labelClass = 'warning'; break; case 'rejected': $labelClass = 'danger'; break; default: $labelClass = 'warning'; break; } @endphp {{ ucfirst($withdrawRequest->status) }}

{{ __('static.user_dashboard.booking_status') }}

@endsection @push('js')