@php $holidayEvent = $event ?? null; $isEdit = (bool) $holidayEvent; $inputClass = 'w-full rounded-lg border border-gray-300 p-2.5 text-sm text-gray-700 focus:border-amber-400 focus:ring-amber-400'; $panelClass = 'rounded-xl border border-gray-100 bg-white p-6 shadow-sm'; $fieldValue = static fn(string $key, mixed $default = null): mixed => old($key, data_get($holidayEvent, $key, $default)); $sendAtValue = old('send_at'); if ($sendAtValue === null && $holidayEvent?->send_at) { $sendAtValue = $holidayEvent->send_at->format('Y-m-d\TH:i'); } $repeatType = (string) $fieldValue('repeat_type', 'once'); $distributeType = (string) $fieldValue('distribute_type', 'random'); $targetType = (string) $fieldValue('target_type', 'all'); $targetValue = old('target_value', data_get($holidayEvent, 'target_value', $targetType === 'level' ? 1 : null)); $scheduleMonth = old('schedule_month', data_get($holidayEvent, 'schedule_month', $holidayEvent?->send_at?->format('n') ?? now()->format('n'))); $scheduleDay = old('schedule_day', data_get($holidayEvent, 'schedule_day', $holidayEvent?->send_at?->format('j') ?? now()->format('j'))); $scheduleTime = old('schedule_time', data_get($holidayEvent, 'schedule_time', $holidayEvent?->send_at?->format('H:i') ?? '20:00')); $durationDays = old('duration_days', data_get($holidayEvent, 'duration_days', 1)); $dailyOccurrences = old('daily_occurrences', data_get($holidayEvent, 'daily_occurrences', 1)); $occurrenceIntervalMinutes = old('occurrence_interval_minutes', data_get($holidayEvent, 'occurrence_interval_minutes', 60)); @endphp
{{ $pageDescription }}