@php $editing = $plan->exists; $canEdit = auth('admin')->user()->can('pricing.edit'); $packages = old('rental_packages', $plan->rental_packages ?: [['hours' => 1, 'km' => 10, 'price' => '', 'extra_km' => '', 'extra_minute' => '']]); $os = old('outstation_settings', $plan->outstation_settings ?? []); $num = fn ($name, $label, $value, $step = '0.01', $hint = null) => ['name' => $name, 'label' => $label, 'value' => $value, 'step' => $step, 'hint' => $hint]; @endphp @if ($editing && $canEdit)
@csrf @method('DELETE') {{ __('Delete') }}
@endif
@csrf @if ($editing) @method('PUT') @endif
{{-- City ride / outstation base pricing --}}
@foreach ([ $num('base_fare', __('Base fare'), $plan->base_fare), $num('base_distance_km', __('Km included in base'), $plan->base_distance_km, '0.1'), $num('per_km', __('Per km'), $plan->per_km), $num('per_minute', __('Per minute'), $plan->per_minute), ] as $f) @endforeach

{{ __('Trip charge = base + (km − included km) × per km + minutes × per minute. Surge multiplies the trip charge (city rides only).') }}

{{-- Rental packages --}}
{{ __('Add package') }} @if ($errors->has('rental_packages*'))

{{ collect($errors->get('rental_packages*'))->flatten()->first() }}

@endif
{{-- Outstation --}}
@error('outstation_settings.per_km_one_way')

{{ $message }}

@enderror

{{ __('Commission is taken from the trip fare only – booking fee, airport fee and tax go to the platform; tolls go to the driver. Promo discounts are paid by the platform.') }}

@if ($canEdit)
{{ $editing ? __('Save changes') : __('Create fare plan') }} {{ __('Cancel') }}
@endif
{{-- Live simulator --}}
@if ($editing)

{{ __('Prices a sample trip with the saved plan using the real pricing engine. Save first to test changes.') }}

@if ($plan->service_type->value === 'rental') @endif @if ($plan->service_type->value === 'ride') @endif @if ($plan->service_type->value === 'outstation') @endif

{{ __('Rider pays') }}
{{ __('Platform commission') }}
{{ __('Driver earns') }}
@else @endif