© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•11mo ago•
1 reply
ikbentomas

withoutGlobalScope in Table filter

I have a model that has a
status
status
column and a globalScope in the Eloquent model
static::addGlobalScope('active', function (Builder $builder) {
  $builder->where('status', 1);
});
static::addGlobalScope('active', function (Builder $builder) {
  $builder->where('status', 1);
});


My intention was to make a filter that would disable that globalScope for the table, it should keep the global scope for the global search.

I tried adding it to the query Builder but that does not have any effect
Filter::make('include_inactive')
  ->query(fn (Builder $query): Builder => $query->withoutGlobalScope('active')),
Filter::make('include_inactive')
  ->query(fn (Builder $query): Builder => $query->withoutGlobalScope('active')),


and removing the globalScope in
getEloquentQuery
getEloquentQuery
ruins the global search.
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

Subquery in table filter
FilamentFFilament / ❓┊help
2y ago
Button filter in table
FilamentFFilament / ❓┊help
3y ago
Table filter
FilamentFFilament / ❓┊help
12mo ago
Custom Table Filter and Applied filters?
FilamentFFilament / ❓┊help
3y ago