FilamentF
Filament10mo ago
Zoltar

refreshFormData in afterSave() function

Hello, simply question:

i try to update a form field after saving data, reading a value from database.

in edit page add this function

protected function afterSave(): void
{
$this->refreshFormData([
'calorie_calc',
]);
}

but not work... any idea?
Regards
Solution
Ok.. just use $this->form->fill($this->record->refresh()->toArray())
Was this page helpful?