@php $fields = isset($offer) ? json_decode($offer->template_fields, true) : []; @endphp

Rooms Table

@if (!empty($fields['rooms'])) @foreach ($fields['rooms'] as $roomIndex => $room) @endforeach @endif
Hotel * Room Category(s) * Check-in Date Check-out Date Total Rate
(per room)
@foreach ($room['categories'] as $index => $category) @php $uniqueId=$roomIndex.$index; @endphp
@if($index===0)   @else   @endif
@endforeach
@foreach ($room['checkin_dates'] as $key => $checkin) @endforeach @foreach ($room['checkout_dates'] as $key => $checkout) @endforeach @foreach ($room['total_rates'] as $rate) @endforeach

Grand Total: {{$fields["grand_total"] ?? ""}}

@php $sections = $fields["sections"] ?? []; // print_r($sections);exit; @endphp
@foreach($sections as $index => $section)
@if($index > 0)
@endif
@endforeach @if (empty($sections)) {{-- Default empty block if no section exists --}}
@endif