@php
$titles = $data['sections'] ?? [];
$descriptions = $data['descriptions'] ?? [];
$isEdit = isset($data['sections']) && isset($data['descriptions']);
// print_r($sections);
// print_r($descriptions);
// exit();
@endphp
@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 commu nicated within this time frame (or no-shows), will result in the charge of the full amount for this service.',
],
[
'title' => 'Changes to Booking',
'description' =>
'Any changes to the booking details, such as flight delays, should be communicated to the service provider in advance.',
],
[
'title' => 'Extra Charges',
'description' =>
'For Round Trips additional pick up(s) and/or drop off(s) extra charges will apply (depending on the distance).',
],
];
}
@endphp
@foreach ($sections as $index => $section)
@endforeach