This project demonstrates the Filament Select field with the ability to refresh the options based on the value of another dropdown option.
The example is with countries and cities: in a form to add a new shop, when you choose a country, the list of cities is refreshed.
For the first select, we generate options from the DB. The first select field must be set to live()
.
The second select input makes a DB request after selecting the value in the first select.
Based on the first select, we set a placeholder for the second select input.
Here is what these two select inputs look like...