© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•6mo ago•
1 reply
daniik

Filter not apply on table query

Hi, I have a problem with a filter query that does not apply to the table. The property type is not database-based, but I take it from other models. So I have a scope ready that returns a query in this form:

select * from subscriptions where subscriptions.id in (11)
select * from subscriptions where subscriptions.id in (11)


The filter query returns the correct SQL query of the same form, but when I apply the filter, it does not appear in the table. Do you have any idea why?

Tables\Filters\SelectFilter::make('type')
                    ->label(__('subscription.properties.type'))
                    ->options(AbonentPackageType::class)
                    ->native(false)
                    ->query(function ($query, $state) {
                        $type = AbonentPackageType::tryFrom($state['value']);

                        if ($type === null) {
                            return $query;
                        }

                        return $query->wherePackageType($type);
                    })
Tables\Filters\SelectFilter::make('type')
                    ->label(__('subscription.properties.type'))
                    ->options(AbonentPackageType::class)
                    ->native(false)
                    ->query(function ($query, $state) {
                        $type = AbonentPackageType::tryFrom($state['value']);

                        if ($type === null) {
                            return $query;
                        }

                        return $query->wherePackageType($type);
                    })
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Filter not apply for the pivot table
FilamentFFilament / ❓┊help
15mo ago
Apply filament tab query filter to table on custom ViewRecord page
FilamentFFilament / ❓┊help
3y ago
How to apply default filter/query for a table
FilamentFFilament / ❓┊help
2y ago
Issue with QueryBuilder Table Filter
FilamentFFilament / ❓┊help
8mo ago