Reactive table filters without Livewire request

I try to customize a table filter to have a simple filter for all the basic fields and a advanced filter for basics and special cases. So far it is working, but every time I toggle between basic and advanced a request is triggered. What would be the approach to do this in the frontend only without the request?
protected function getTableFilters(): array
{
    return [
        Filter::make('my_filtere')
            ->form([
                        Forms\Components\Toggle::make('advanced_filter') 
                            ->default(false)
                            ->dehydrated(false),
                        Forms\Components\Select::make('country_id')
                            ->label('Land')
                            ->options(Country::all()->pluck('full_name', 'id')->toArray()),
                        Forms\Components\Select::make('region_id')
                            ->label('Region')
                            ->options(Region::all()->pluck('full_name', 'id')->toArray()),
                        Forms\Components\Select::make('subregion_id')
                            ->hidden(fn (Closure $get) => $get('advanced_filter') == false) //has to be in the same form !!!
                            ->label('Subregion')
                            ->options(Subregion::all()->pluck('full_name', 'id')->toArray()),
                    ])
            ];
}
Was this page helpful?