How to access to the selected option in the SelectFilter?
I have provided options to a SelectFilter and everything works as expected. I have a special case where I need to modify the query if one specific option gets selected. How could I access to the selected option? Is it possible to modify the query based on the selected options?
I thought about chaining
when
method to the filter, but I just don't know how can I have access to the selected option so that I can replace the true
part with the condition.
Solution:Jump to solution
use
->query()
```
->query(function (Builder $query, array $data): Builder {
return $query...2 Replies