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.
1 Reply
krekas
krekas3w ago
modify the query itself. now you are trying to add method to the tab