How to implement a dynamic form in an action
I would like to display fields based on a database entry.
I have this action:
Now the returns an array with a schema
However, when i select an education the initial value just gets reset in the select instead of seeing the new form.
How can i do this?
1 Reply
The form fields i want to display:
the form does not have a fixed set of fields, but its dependant on how many courses there are
oh i fixed it somehow
I removed the fill method, now its just displaying the form
mm without calling fill it wont set any default values it seems
Select::make('location.'.$course->id)
->options(
Location::orderBy('name')->pluck('name', 'id')
)
->default(
Location::where('name', 'Company')->first()?->id
)
->label('Locatie')
->required(),