@php $enableHolidayHour = $field['enableHolidayHour'] ?? false; $holidayName = $field['holidayName'] ?? ''; $holidayHour = $field['holidayHour'] ?? ''; $valueDates = json_decode($holidayHour, true); $value = old($field['name']) ?? ($field['value'] ?? []); if (is_string($value)) { $value = json_decode($value, true) ?? []; } /** * Ensure at least 1 block exists */ if (empty($value)) { $value = [ [ 'holiday' => 'new_year', 'dates' => [ [ 'date' => '', 'open_time' => '', 'close_time' => '', ] ] ] ]; } $holidays = [ 'new_year' => 'New Year', 'waitangi_day' => 'Waitangi Day', 'easter' => 'Easter', 'anzac' => 'Anzac Day', 'kings_birthday' => "King's Birthday", 'matariki' => 'Matariki', 'labour' => 'Labour Day', 'christmas' => 'Christmas', ]; @endphp
@foreach($value as $hIndex => $block)
Enable
{{-- --}}
@foreach(($valueDates ?? []) as $dIndex => $row)
Is Closed?
@endforeach
@endforeach
{{-- --}}
@push('after_scripts') @endpush