@php $schedule = $schedule ?? null; $defaults = $defaults ?? []; $value = fn (string $field, mixed $fallback = null) => old($field, $schedule?->{$field} ?? $defaults[$field] ?? $fallback); $timeValue = function (string $field) use ($schedule) { $raw = old($field, $schedule?->{$field}); return $raw ? substr((string) $raw, 0, 5) : ''; }; $dateValue = function (string $field) use ($schedule, $defaults) { $raw = old($field, $schedule?->{$field} ?? $defaults[$field] ?? null); if (! $raw) { return ''; } return $raw instanceof \DateTimeInterface ? $raw->format('Y-m-d') : substr((string) $raw, 0, 10); }; $action = $schedule ? route('clinic-schedules.update', $schedule) : route('clinic-schedules.store'); $doctorDepartments = $doctorDepartments ?? []; @endphp
@csrf @if ($schedule) @method('PUT') @endif

minutes cut into slots of minutes.

Cancel