© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
10 replies
monzer

how to hide table records until a filter is applied?

how to hide table records until a filter is applied?
Solution
->modifyQueryUsing(function(Builder $query, $livewire){
    if(!empty($livewire->tableFilters)){
        if(
            !empty($livewire->tableFilters['some_filter']['some_filter'])
        ){
            return $query;
        }
        return $query->where('id',0);
    }
})
->modifyQueryUsing(function(Builder $query, $livewire){
    if(!empty($livewire->tableFilters)){
        if(
            !empty($livewire->tableFilters['some_filter']['some_filter'])
        ){
            return $query;
        }
        return $query->where('id',0);
    }
})
Jump to solution
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

Custom Table Filter and Applied filters?
FilamentFFilament / ❓┊help
3y ago
Hide all records in the table
FilamentFFilament / ❓┊help
2y ago
Get the records of a Table (with filters applied)
FilamentFFilament / ❓┊help
3y ago
how to hide other field in select table filter according to another filter
FilamentFFilament / ❓┊help
7mo ago