@foreach(config('constant.collection_days') as $key => $day)
@php $currentDay = null; @endphp
@if($is_update && isset($schoolTimings) && !empty($schoolTimings))
@php
$currentDay = collect($schoolTimings)->where('day', $key)->first();
@endphp
@endif
@if($currentDay!=null && !empty($currentDay->periods))
@php $count = 1; @endphp
@foreach($currentDay->periods as $key1 => $period)
@php
$fromTime = $toTime = "";
if(isset($period->fromTime)){
$fromTime = \Carbon\Carbon::createMidnightDate(date('Y-m-d'))->addMinutes($period->fromTime)->format('h:i A');
}
if(isset($period->toTime)){
$toTime = \Carbon\Carbon::createMidnightDate(date('Y-m-d'))->addMinutes($period->toTime)->format('h:i A');
}
@endphp
@php $count++; @endphp
@endforeach
@else
@endif
@endforeach