diff --git a/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/CreateBeneficiary.php b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/CreateBeneficiary.php index f3571c6f..1efeb4dd 100644 --- a/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/CreateBeneficiary.php +++ b/app/Filament/Organizations/Resources/BeneficiaryResource/Pages/CreateBeneficiary.php @@ -352,6 +352,10 @@ protected function getSteps(): array ->schema(EditChildrenIdentity::getChildrenIdentityFormSchema()) ->afterStateHydrated( function (Set $set) { + if (! $this->parentBeneficiary?->children->count()) { + return; + } + $children = $this->parentBeneficiary?->children->toArray() ?? []; foreach ($children as &$child) { $child['birthdate'] = $child['birthdate'] ? Carbon::parse($child['birthdate'])->format('d.m.Y') : null;