Set formData on an Infolist action form

I have the following infolist action form (excerpt)
TextEntry::make('user.details')
->suffixActions([
Action::make('editDetails')
->form([
TextInput::make('name'),
Select::make('title')
])
->formData([]) // Cant set this
->action(function (array $data, $record) {
$record->details()->update($data);
}),
])
TextEntry::make('user.details')
->suffixActions([
Action::make('editDetails')
->form([
TextInput::make('name'),
Select::make('title')
])
->formData([]) // Cant set this
->action(function (array $data, $record) {
$record->details()->update($data);
}),
])
How can I pre-fill this form? I tried doing the following
$details = $this->getRecord()->details->attributesToArray();

...

->formData($details)
$details = $this->getRecord()->details->attributesToArray();

...

->formData($details)
but it doesn't work. Is this possible? Am I doing something wrong?
Solution:
Nvm, I'm an idiot. There's a ->fillForm method that does what I want.
Jump to solution
1 Reply
Solution
ChesterS
ChesterS13mo ago
Nvm, I'm an idiot. There's a ->fillForm method that does what I want.
Want results from more Discord servers?
Add your server