@php $titles = $data['sections'] ?? []; $descriptions = $data['descriptions'] ?? []; $isEdit = isset($data['sections']) && isset($data['descriptions']); // print_r($sections); // print_r($descriptions); // exit(); //print_r($data); //xit(); @endphp
@if ($data['legs'] ?? []) @foreach ($data['legs'] as $index => $leg) @include('confirmations.forms.partials.leg_form', ['index' => $index, 'leg' => $leg]) @endforeach @else @include('confirmations.forms.partials.leg_form', ['index' => 0]) @endif



Sections
@php $sections = []; if ($isEdit) { foreach ($titles as $i => $title) { $sections[] = [ 'title' => $title, 'description' => $descriptions[$i] ?? '', ]; } } else { $sections = [ [ 'title' => 'Cancellation Policy', 'description' => 'Cancellation for this service is 24 hours prior to the scheduled time. Cancellations not communicated within this time frame (or no-shows), will result in the charge of the full amount for this service.', ], [ 'title' => 'Flight Crew', 'description' => '', ], ]; } @endphp @foreach ($sections as $index => $section)
@endforeach {{--
@if (old('handling_facilities', isset($confirmation) ? $confirmation->handling_facilities : [])) @foreach (old('handling_facilities', $confirmation->handling_facilities ?? []) as $index => $facility) @include('confirmations.forms.partials.handling-facility', [ 'index' => $index, 'facility' => $facility, ]) @endforeach @else @for ($i = 0; $i < 2; $i++) @include('confirmations.forms.partials.handling-facility', [ 'index' => $i, ]) @endfor @endif
--}}