© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•12mo ago•
2 replies
Señor Nikola

Toggle Column Prevent Action

Hello,

I have an issue cannot seem to figure out where to place my check on record if it has all requried fields - only than it can be activated.

I tried beforeStateUpdated but it throws warning but still proceeds to update that record? Any idea how to prevent it?

Tables\Columns\ToggleColumn::make('active')
                    ->disabled(function (Project $record) {
                        return !$record->hasAllRequiredFields();
                    })
                    ->afterStateUpdated(function(){
                        Cache::forget(CacheManager::makeCacheToken("active_projects"));

                        Notification::make()
                            ->success()
                            ->title(__("Project Status Updated"))
                            ->send();
                    }),
Tables\Columns\ToggleColumn::make('active')
                    ->disabled(function (Project $record) {
                        return !$record->hasAllRequiredFields();
                    })
                    ->afterStateUpdated(function(){
                        Cache::forget(CacheManager::makeCacheToken("active_projects"));

                        Notification::make()
                            ->success()
                            ->title(__("Project Status Updated"))
                            ->send();
                    }),
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

Filament Checkbox Column toggle prevent query update
FilamentFFilament / ❓┊help
4mo ago
Toggle-column
FilamentFFilament / ❓┊help
2y ago
Toggle column issue.
FilamentFFilament / ❓┊help
3y ago
How To Disable a Table Column Reactively After Toggle Column Action
FilamentFFilament / ❓┊help
3y ago