© 2026 Hedgehog Software, LLC

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

Access table filter in togglable

Is there a way around this error I'm getting when trying to access the filter inside
toggleable
toggleable

Typed property Filament\Resources\Products\ListRecords::$cachedTableFilters must not be accessed before initialization

I guess 'toggleable' form is setup before the table filters.
$table
    ->columns([
        Tables\Columns\TextColumn::make('category')
            ->toggleable(fn (ListRecords $livewire) => $livewire->getCachedTableFilter('filter')->getState()['category_id'] ?? false)
    ])
    ->filters([
        Tables\Filters\Filter::make('filter')
            ->form([
                Forms\Components\Select::make('category_id')
                    ->reactive()
                    ->afterStateUpdated(fn ($state, \Closure $set) => $set('category_id', $state))
$table
    ->columns([
        Tables\Columns\TextColumn::make('category')
            ->toggleable(fn (ListRecords $livewire) => $livewire->getCachedTableFilter('filter')->getState()['category_id'] ?? false)
    ])
    ->filters([
        Tables\Filters\Filter::make('filter')
            ->form([
                Forms\Components\Select::make('category_id')
                    ->reactive()
                    ->afterStateUpdated(fn ($state, \Closure $set) => $set('category_id', $state))
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

How to access filter values in other filter field in table filter
FilamentFFilament / ❓┊help
6mo ago
withoutGlobalScope in Table filter
FilamentFFilament / ❓┊help
11mo ago
Subquery in table filter
FilamentFFilament / ❓┊help
2y ago
Button filter in table
FilamentFFilament / ❓┊help
3y ago