Trying to update Select field options when another field is updated?
Here is my code below. locations is a variable on my livewire component that contains the form schema
Not sure if "after state updated" is where this type of logic should go. But basically, I send the state in (true or false) and based on that i run a filter and return the locations. The locations value is being changed by this afterStateUpdated hook, but the options in the below select field "fromLocation" aren't being updated.
2 Replies
i think i replied on github
You dont need to store the options, you just pass a closure to the options() method. https://filamentphp.com/docs/2.x/forms/fields#dependant-selects