Edit Promotion
Edit Promotion
{{ $promotion->name }}
← Back
@csrf @method('PUT')
@error('name')

{{ $message }}

@enderror
@error('starts_at')

{{ $message }}

@enderror
@error('ends_at')

{{ $message }}

@enderror
is_active ? '1' : '0') == '1' ? 'checked' : '' }} style="width:16px;height:16px;accent-color:#1A4FA0;cursor:pointer;">

Services & Promo Prices

Tick a service to include it. Per-variation prices are shown for services with vehicle-type variations.

@php // Build lookup: service_id => [variation_id|null => promo_price] $existingPrices = []; foreach ($promotion->services as $ps) { $varId = $ps->pivot->variation_id ? (int)$ps->pivot->variation_id : null; $existingPrices[$ps->id][$varId] = (float)$ps->pivot->promo_price; } $promoServiceIds = array_keys($existingPrices); @endphp
@foreach($services as $i => $svc) @php $hasVariations = $svc->variations->isNotEmpty(); $inPromo = in_array($svc->id, $promoServiceIds); @endphp
@if(!$hasVariations) @php $basePromo = $existingPrices[$svc->id][null] ?? $svc->price; @endphp Normal: KSh {{ number_format($svc->price, 2) }} @else {{ $svc->variations->count() }} variations ▾ @endif
@if($hasVariations)
@foreach($svc->variations as $vi => $var) @php $varPromo = $existingPrices[$svc->id][$var->id] ?? $var->price; @endphp @endforeach
Vehicle Type Normal Price Promo Price
{{ $var->vehicle_type }} KSh {{ number_format($var->price, 2) }}
@endif
@endforeach
@push('scripts') @endpush