Skip to content

Commit

Permalink
Display min 1 item in children table
Browse files Browse the repository at this point in the history
  • Loading branch information
alexPopaCode4 committed Jan 9, 2025
1 parent 5ca215e commit 745178c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 745178c

Please sign in to comment.