@php $formKey = isset($recipient) ? (string) $recipient->id : 'new'; $useOldInput = (string) old('recipient_key') === $formKey; $formEvents = $useOldInput ? old('events', []) : ($recipient->events ?? []); $formActive = $useOldInput ? (bool) old('is_active') : ($recipient->is_active ?? true); @endphp