© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
AlexAnder

How to "disable globalScope" in "Listing records" when "Using tabs to filter the records"

use Filament\Resources\Components\Tab;
use Illuminate\Database\Eloquent\Builder;
 
public function getTabs(): array
{
    return [
        'all' => Tab::make(),
        'childrens' => Tab::make()
            ->modifyQueryUsing(fn (Builder $query) => $query->whereHas('childrens'))
            ->withoutGlobalScopes(), // the global scope is belongsTo(auth()->user())
    ];
}
use Filament\Resources\Components\Tab;
use Illuminate\Database\Eloquent\Builder;
 
public function getTabs(): array
{
    return [
        'all' => Tab::make(),
        'childrens' => Tab::make()
            ->modifyQueryUsing(fn (Builder $query) => $query->whereHas('childrens'))
            ->withoutGlobalScopes(), // the global scope is belongsTo(auth()->user())
    ];
}

"->withoutGlobalScopes()" doesn't work.
Solution
modify the query itself. now you are trying to add method to the tab
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

Using tabs to filter the records in a TableWidget
FilamentFFilament / ❓┊help
2y ago
How to use same column attribute in a Table Filter AND in Listing records (Using tabs to filter)
FilamentFFilament / ❓┊help
2y ago
Default Table Filter when using Tabs
FilamentFFilament / ❓┊help
3y ago
Tabs to filter the records(Panel Builder) not working
FilamentFFilament / ❓┊help
3y ago