F
Filamentβ€’7mo ago
bardolf_6969

Use value from first select filter to limit results in second select filter

I've got the standard city, state, country setup and can access all the relevant details in the table itself.
What I'm hoping to do is in the city table I have 2 select filters. 1 for country and one for state. I'd like it so that once they select a country it reduces the options in the state select to only have states from that country. I know I can customize the relationship callback for the select filter but how can I access the value selected in the first select?
Solution:
Using a Filter Form you should be able to use get, see how it was acheived here: https://github.com/filamentphp/filament/discussions/2891...
GitHub
table filters dependent fields Β· filamentphp filament Β· Discussion ...
It would be awesome to bring in the magic of filament/forms special DI $get when creating table filters. The use case would be to allow callbacks inside of $filter->options() to access other dep...
Jump to solution
3 Replies
Solution
toeknee
toekneeβ€’7mo ago
Using a Filter Form you should be able to use get, see how it was acheived here: https://github.com/filamentphp/filament/discussions/2891
GitHub
table filters dependent fields Β· filamentphp filament Β· Discussion ...
It would be awesome to bring in the magic of filament/forms special DI $get when creating table filters. The use case would be to allow callbacks inside of $filter->options() to access other dep...
bardolf_6969
bardolf_6969OPβ€’7mo ago
@toeknee excellent thank you very much. That was almost exactly what I needed πŸ™‚ I must say the community here is excellent. I've been working with Splade for the last year or so, and while I love the package there isn't a lot of support.
toeknee
toekneeβ€’7mo ago
Aww love that! Splade is great, but Dan's created something so prefect here it's got traction and built a create community πŸ˜„
Want results from more Discord servers?
Add your server