malzariey/filament-daterangepicker-filter

Cannot apply modified base query

sawirricardo opened this issue · 1 comments

I have a use case where I use ->modifyBaseQuery() with https://github.com/tpetry/laravel-postgresql-enhanced

However, daterangepicker hardcodes the apply() method with concrete query builder class.

Suggestion is to use the Contract interface Query Builder instead of the concrete one...

What do you think? @malzariey

Hey @sawirricardo,

Thank you for raising the issue.

Unfortunately, Filament is using the Concrete query builder as well. Hence, we would not be able to change the signature of the parent class (Filter).

Declaration of Malzariey\FilamentDaterangepickerFilter\Filters\DateRangeFilter::apply(Illuminate\Contracts\Database\Eloquent\Builder $query, array $data = []): Illuminate\Contracts\Database\Eloquent\Builder must be compatible with Filament\Tables\Filters\BaseFilter::apply(Illuminate\Database\Eloquent\Builder $query, array $data = []): Illuminate\Database\Eloquent\Builder