@php $mode = $mode ?? 'create'; $isEdit = $mode === 'edit'; $modalAppointment = $modalAppointment ?? null; $modalId = $modalId ?? ($isEdit ? 'edit-appointment-modal-' . $modalAppointment->id : 'create-appointment-modal'); $formId = $isEdit ? 'edit-appointment-form-' . $modalAppointment->id : 'create-appointment-form'; $action = $isEdit ? route('admin.appointments.update', $modalAppointment) : route('admin.appointments.store'); $selectedCustomer = old('customer_id', $modalAppointment?->customer_id); $selectedService = old('service_id', $modalAppointment?->service_id); $selectedStaff = old('staff_profile_id', $modalAppointment?->staff_profile_id); $selectedStatus = old('status', $modalAppointment?->status_value ?? \App\Enums\AppointmentStatus::Pending->value); $selectedPayment = old('payment_status', $modalAppointment?->payment_status ?? 'unpaid'); @endphp
@csrf @if ($isEdit) @method('PUT') @endif Cancel {{ $isEdit ? 'Update Appointment' : 'Save Appointment' }}