{{-- Country -> Destination -> Route/Vehicle cascade shared by the trip-schedule, booking and expense forms. Expects selects with ids route_country and route_destination, plus any of: - transport_route_id (data-selected = saved route id), fed by $routes - vehicle_id (data-selected = saved vehicle id), fed by $vehicles Options are rebuilt rather than hidden because option[hidden] is unreliable across browsers. --}} @php $cascadeDestinations = $destinations ->map(fn($d) => ['id' => (string) $d->id, 'name' => $d->name, 'country_id' => (string) $d->country_id]) ->values(); $cascadeRoutes = ($routes ?? collect()) ->map(fn($r) => [ 'id' => (string) $r->id, 'name' => $r->name, 'country_id' => (string) ($r->country_id ?? ''), 'destination_id' => (string) ($r->destination_id ?? ''), ]) ->values(); $cascadeVehicles = ($vehicles ?? collect()) ->map(fn($v) => [ 'id' => (string) $v->id, 'name' => $v->name, 'country_id' => (string) ($v->country_id ?? ''), 'destination_id' => (string) ($v->destination_id ?? ''), ]) ->values(); @endphp @push('scripts') @endpush