How to Make Multiple Select Filters Combine with 'And' Logic Instead of 'Or' Logic in FilamentPHP?
When I select multiple options from a single Select Filter, it treats them as an orWhere, which is expected. However, when I select options simultaneously from two or more Select Filters, it also treats them as orWhere. However, I need them to be treated as andWhere. How can I achieve this behavior?
Here are two examples of the filters:
1 Reply
This is an old post, but I'm in v3 and I'm trying to do something similar. I've achieved it using custom select filters, which are then updating a component property
$this->filter_value
, which is then being checked in $table->modifyQueryUsing
. This works, but I'm wondering if there is a neater way to implement this.
ah, just found a better way to do this: ->baseQuery
This is cool, but if you you Filter (instead of SelectFilter), you can use ->form() to have more control over the form and it's reactivity.