@php $happyHourBegin = $promotion->happy_hours_begin ?? 0; $happyHourBeginHH = (int)($happyHourBegin/60); $happyHourBeginMM = (($happyHourBegin-$happyHourBeginHH) > 0) ? ($happyHourBegin-($happyHourBeginHH*60)) : ''; $happyHourEnd = $promotion->happy_hours_end ?? 0; $happyHourEndHH = (int)($happyHourEnd/60); $happyHourEndMM = (($happyHourEnd-$happyHourEndHH) > 0) ? ($happyHourEnd-($happyHourEndHH*60)) : ''; $happyHourBeginHH = old('happy_hours_begin_hh', $happyHourBegin > 0 ? $happyHourBeginHH : ''); $happyHourBeginMM = old('happy_hours_begin_mm', $happyHourBegin > 0 ? $happyHourBeginMM : ''); if($happyHourBegin > 0) { $happyHourBeginHH = str_pad($happyHourBeginHH,2,'0',STR_PAD_LEFT); $happyHourBeginMM = str_pad($happyHourBeginMM,2,'0',STR_PAD_LEFT); } $happyHourEndHH = old('happy_hours_end_hh', $happyHourEnd > 0 ? $happyHourEndHH : ''); $happyHourEndMM = old('happy_hours_end_mm', $happyHourEnd > 0 ? $happyHourEndMM : ''); if($happyHourEnd > 0) { $happyHourEndHH = str_pad($happyHourEndHH,2,'0',STR_PAD_LEFT); $happyHourEndMM = str_pad($happyHourEndMM,2,'0',STR_PAD_LEFT); } @endphp