@php $titles = $data['sections'] ?? []; $descriptions = $data['descriptions'] ?? []; $isEdit = isset($data['sections']) && isset($data['descriptions']); // print_r($sections); // print_r($descriptions); // exit(); @endphp

Room Types
@if (!empty($data['room_types'])) @foreach ($data['room_types'] as $index => $room)
@endforeach @endif

Sections
@php $sections = []; if ($isEdit) { foreach ($titles as $i => $title) { $sections[] = [ 'title' => $title, 'description' => $descriptions[$i] ?? '', ]; } } else { $sections = [ [ 'title' => 'Amendments & Extensions', 'description' => 'Should you wish to extend, modify, or cancel your stay, we kindly ask that you contact our team directly rather than reaching out to the hotel. We will be pleased to assist you with any changes and ensure a smooth process.', ], [ 'title' => 'Charges & Taxes', 'description' => 'Please note there will be additional city taxes to be paid at the check in time.', ], [ 'title' => 'Cancellation Policy', 'description' => 'Please note if cancelled, booking is non-refundable.', ], [ 'title' => 'Check-in / Check-out', 'description' => 'The standard check-in time is from 3:00 PM and check-out is by 12:00 PM. We have, however, placed a request on your behalf for an early check-in and late check-out, subject to availability.', ], [ 'title' => 'Important Notice', 'description' => 'It is required that guests must present a valid ID OR physical Passport for check-in. This is applicable for every individual staying in the room or visiting.', ], [ 'title' => 'Security Deposit', 'description' => 'Please note that a security deposit may be required by the hotel upon check-in. This can be provided either in cash or via credit card pre-authorization. The deposit will cover any incidental or additional charges incurred during the stay. Any unused amount will be refunded or released upon check-out, in accordance with the hotel’s policy.', ], ]; } @endphp @foreach ($sections as $index => $section)
@endforeach