F
Filament4d ago
Adel

fill form with initial data before show form

I need to fill the form with initial data before the form is show.. I don't want to do it on field level .. I want to modify the whole data/state
4 Replies
igorclauss
igorclauss4d ago
In which context? Are you in a filament resource or a custom livewire component?
Adel
Adel4d ago
@igorclauss filament resource.. I want to initiate the Builder field with initial data so it will shown when the form is shown
igorclauss
igorclauss4d ago
You have access to the state on the createResourcePage, also there are lifecycle hooks. But maybe it is still the best to use defaults on field level. It depends on what you want to achieve
Adel
Adel4d ago
I am using simple resource. I am doing almost the same in another resource using afterStateUpdate using $set('builder_field', []) . because it depends on another field. but this time it doesn't depend on another field so I need to modify it before the form is shown oh I am using regular resource but with modal
Want results from more Discord servers?
Add your server