TernaryFilter not working with date column?

I've got this same filter working on a varchar column, but on a date column with:
TernaryFilter::make('dob')
->label('Date of Birth?')
->trueLabel('Has Date of Birth')
->falseLabel('Missing Date of Birth?')
->queries(
true: fn (Builder $query): Builder => $query->whereNotNull('dob'),
false: fn (Builder $query): Builder => $query->whereNull('dob'),
)
->nullable(),
TernaryFilter::make('dob')
->label('Date of Birth?')
->trueLabel('Has Date of Birth')
->falseLabel('Missing Date of Birth?')
->queries(
true: fn (Builder $query): Builder => $query->whereNotNull('dob'),
false: fn (Builder $query): Builder => $query->whereNull('dob'),
)
->nullable(),
it never gets applied and so it doesn't run.
2 Replies
Dennis Koch
Dennis Koch2y ago
Not sure why there should be any difference
toeknee
toekneeOP2y ago
Exactly... The query shows that's run; where (email is not null) order by dob desc limit 25 offset 0 orders by dob but won't where? But email does where
Want results from more Discord servers?
Add your server