@if($bookingTime->status == 'enabled')
@php $slot_count = 1; $check_remaining_booking_slots = 0; @endphp
@for($d = $startTime;$d < $endTime;$d->addMinutes($service->time))
@php $slotAvailable = 1; @endphp
@if($bookingTime->multiple_booking === 'no' && $bookings->count() > 0)
@foreach($bookings as $booking)
@if($booking->date_time->format($settings->time_format) == $d->format($settings->time_format))
@php $slotAvailable = 0; @endphp
@endif
@endforeach
@endif
@if($bookingTime->multiple_booking === 'yes' && $bookingTime->max_booking != 0)
@php $currentTimeCount = 0; @endphp
@foreach($bookings as $booking)
@if($booking->date_time->format($settings->time_format) == $d->format($settings->time_format))
@php $currentTimeCount++; @endphp
@endif
@endforeach
@if($currentTimeCount >= $bookingTime->max_booking)
@php $slotAvailable = 0; @endphp
@endif
@endif
@foreach($disabledTimes as $disabledTime)
@if(date('H:i:s',strtotime($disabledTime->start_time)) <= $d->format('H:i:s') && date('H:i:s',strtotime($disabledTime->end_time)) > $d->format('H:i:s'))
@php $slotAvailable = 0; @endphp
@endif
@endforeach
@if($slotAvailable == 1)
@php $check_remaining_booking_slots++; @endphp
@endif
@php $slot_count++; @endphp
@endfor
@else
@endif