{{ __('message.riderequest') }}

#{{ $data->id }}

{{ __('message.pickup_address') }}

{{ $data->start_address }}

@if(!empty($data->multi_drop_location) || !empty($data->drop_location)) @php // Ensure both are properly formatted and used accordingly if (!empty($data->multi_drop_location)) { // Decode only if it's a JSON string $dropLocations = is_string($data->multi_drop_location) ? json_decode($data->multi_drop_location, true) : $data->multi_drop_location; } elseif (!empty($data->drop_location)) { // Decode only if it's a JSON string $dropLocations = is_string($data->drop_location) ? json_decode($data->drop_location, true) : $data->drop_location; } else { $dropLocations = []; } @endphp
@if(!empty($dropLocations)) @foreach($dropLocations as $item)

{{ $item['address'] ?? '-' }}
{{ __('message.dropped_at') }}: {{ !empty($item['dropped_at']) ? date('Y-m-d H:i', strtotime($item['dropped_at'])) : '-' }}

@endforeach @else

{{ __('message.no_multi_drop_location') }}

@endif
@endif

{{ __('message.drop_address') }}

{{ $data->end_address }}

@if(optional($data)->payment != null && optional($data)->payment->payment_status == 'paid')

{{ __('message.total_distance') }}

{{ $data->distance }} {{ $data->distance_unit }}

{{ __('message.total_duration') }}

{{ $data->duration }} {{ __('message.min') }}

{{ __('message.admin_commission') }}

{{ getPriceFormat(optional($data->payment)->admin_commission ?? 0 ) }}

{{ __('message.driver_earning') }}

{{ getPriceFormat(optional($data->payment)->driver_commission ?? 0 ) }}
@endif

{{ __('message.payment') }}

{{-- @dd($data->ride_has_bid == 1) --}} @if(optional($data)->payment != null && optional($data)->payment->payment_status == 'paid') @php $distance_unit = $data->distance_unit; @endphp @if ($data->ride_has_bid == 1)
  • {{ __('message.payment_method') }} {{ $data->payment_type ?? '-' }}
  • {{ __('message.extra_charges') }} @if(count($data->extra_charges) > 0) @php $extra_charges = collect($data->extra_charges)->pluck('key')->implode(', '); @endphp {{ $extra_charges }} @else @endif {{ getPriceFormat($data->extra_charges_amount) }}
  • {{ __('message.bid_amount') }} {{ $data->surge_amount ? ($data->approvedBids->bid_amount + $data->surge_amount) : $data->approvedBids->bid_amount }}
  • {{ __('message.total_amount') }} {{ $data->surge_amount ? ($data->approvedBids->bid_amount + $data->extra_charges_amount) : $data->approvedBids->bid_amount }}
@else
    @if($data->minimum_fare == ( $data->subtotal - $data->extra_charges_amount ))
  • {{ __('message.minimum_fare') }} {{ getPriceFormat($data->minimum_fare) }}
  • @else
  • {{ __('message.base_fare') }} {{ __('message.for_first') }} {{ $data->base_distance }} {{ __('message.'.$distance_unit) }} {{ getPriceFormat($data->base_fare) }}
  • {{ __('message.distance') }} @if($data->distance > $data->base_distance) {{ $data->distance - $data->base_distance }} {{ $distance_unit }} x {{ $data->per_distance }}/{{ __('message.'.$distance_unit) }} @else {{ $data->distance }} {{ $distance_unit }} x {{ $data->per_distance }}/{{ __('message.'.$distance_unit) }} @endif {{ getPriceFormat($data->per_distance_charge) }}
  • {{ __('message.duration') }} {{ $data->duration }} {{ __('message.min') }} x {{ $data->per_minute_drive }}/{{ __('message.min') }} {{ getPriceFormat($data->per_minute_drive_charge) }}
  • {{ __('message.wait_time') }} @if($data->waiting_time == 0) @else {{ $data->waiting_time }} {{ __('message.min') }} x {{ $data->per_minute_waiting }}/{{ __('message.min') }} @endif {{ getPriceFormat($data->per_minute_waiting_charge) }}
  • @endif
  • {{ __('message.extra_charges') }} @if(count($data->extra_charges) > 0) @php $extra_charges = collect($data->extra_charges)->pluck('key')->implode(', '); @endphp {{ $extra_charges }} @else @endif {{ getPriceFormat($data->extra_charges_amount) }}
  • {{ __('message.tip') }} {{ getPriceFormat($data->tips) }}
  • {{ __('message.coupon_discount') }} {{ getPriceFormat($data->coupon_discount) }}
  • {{ __('message.fixed_charges') }} {{ getPriceFormat($data->surge_amount) }}
  • {{ __('message.total_amount') }} {{ getPriceFormat($data->total_amount) }}
@endif @else
  • {{ __('message.payment_method') }} {{ $data->payment_type ?? '-' }}
  • {{ __('message.amount') }} {{ optional($data->payment)->total_amount ? getPriceFormat(optional($data->payment)->total_amount - ($data->coupon_discount ?? 0)) : '-' }}
@endif
@if(count($data->rideRequestHistory) > 0)

{{ __('message.activity_timeline') }}

    @php $sequence = [ 'new_ride_requested', 'bid_placed', 'bid_rejected', 'bid_accepted', 'arrived', 'in_progress', 'completed', 'payment_status_message', ]; $bidPlacedDrivers = []; $bidRejectedDrivers = []; $historyEntries = []; $colorMapping = [ 'new_ride_requested' => 'border-info text-info', 'bid_placed' => 'border-success text-success', 'bid_rejected' => 'border-danger text-danger', 'bid_accepted' => 'border-success text-success', 'arrived' => 'border-warning text-warning', 'in_progress' => 'border-primary text-primary', 'completed' => 'border-secondary text-secondary', 'payment_status_message' => 'border-dark text-dark', 'driver_declined' => 'border-danger text-danger', ]; foreach ($data->rideRequestHistory as $history) { $historyData = is_string($history->history_data) ? json_decode($history->history_data, true) : $history->history_data; // Decode as associative array if ($history->history_type === 'driver_declined') { $historyEntries[] = [ 'type' => 'driver_declined', 'message' => ''. $history->history_message .'', 'datetime' => $history->datetime, ]; } elseif (in_array($history->history_type, ['bid_placed', 'bid_rejected'])) { $driverName = $historyData['driver_name'] ?? ''; $driverId = $historyData['driver_id'] ?? ''; $driverLink = ''. $driverName . ' ('.$driverId .')' . ''; if ($history->history_type === 'bid_placed') { $bidPlacedDrivers[] = $driverLink; } else { $bidRejectedDrivers[] = $driverLink; } } else { $historyEntries[] = [ 'type' => $history->history_type, 'message' => $history->history_message, 'datetime' => $history->datetime, ]; } } if ($bidPlacedDrivers) { $historyEntries[] = [ 'type' => 'bid_placed', 'message' => 'Placed bids drivers: ' . implode(' , ', $bidPlacedDrivers), 'datetime' => now(), ]; } if ($bidRejectedDrivers) { $historyEntries[] = [ 'type' => 'bid_rejected', 'message' => 'Rejected bids: ' . implode(' , ', $bidRejectedDrivers), 'datetime' => now(), ]; } usort($historyEntries, function ($a, $b) use ($sequence) { return array_search($a['type'], $sequence) - array_search($b['type'], $sequence); }); @endphp @foreach($historyEntries as $entry) @php // Get the color class based on the type $colorClass = $colorMapping[$entry['type']] ?? 'border-primary text-primary'; @endphp
  • {{ __('message.' . $entry['type']) }}
    {{ $entry['datetime'] }}

    {!! $entry['message'] !!}

  • @endforeach
@endif

{{ __('message.detail_form_title', [ 'form' => __('message.rider') ]) }}

rider-profile
@if( $data->is_ride_for_other == 0 )

{{ optional($data->rider)->display_name }}

{{ optional($data->rider)->contact_number }}

{{ optional($data->rider)->email }}

{{ optional($data->rideRequestRiderRating())->rating }} @if( optional($data->rideRequestRiderRating())->rating > 0 ) @endif

@else

{{ __('message.booked_by') }}: {{ optional($data->rider)->display_name }}

@if(!empty($data->other_rider_data)) @foreach($data->other_rider_data as $key)

{{ $key ?? '' }}

@endforeach @endif @endif
@if( isset($data->driver) )

{{ __('message.detail_form_title', [ 'form' => __('message.driver') ]) }}

driver-profile

{{ optional($data->driver)->display_name }}

{{ optional($data->driver)->contact_number }}

{{ optional($data->driver)->email }}

{{ optional($data->rideRequestDriverRating())->rating }} @if( optional($data->rideRequestDriverRating())->rating > 0 ) @endif

@endif

{{ __('message.detail_form_title', [ 'form' => __('message.service') ]) }}

service-detail

{{ optional($data->service)->name }}