© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
ScottyG

Toggle column is not updating until page refresh

                ToggleIconColumn::make('favorite')
                    ->onIcon('heroicon-s-star')
                    ->offIcon('heroicon-o-star')
                    ->updateStateUsing(fn (ResourceModel $record) => $record->isFavorite() ? $record->unsetFavorite() : $record->setFavorite())
                    ->getStateUsing(fn (ResourceModel $record) => $record->isFavorite())
                ToggleIconColumn::make('favorite')
                    ->onIcon('heroicon-s-star')
                    ->offIcon('heroicon-o-star')
                    ->updateStateUsing(fn (ResourceModel $record) => $record->isFavorite() ? $record->unsetFavorite() : $record->setFavorite())
                    ->getStateUsing(fn (ResourceModel $record) => $record->isFavorite())


The code updates the database properly but does not show the change in the table until the page is refreshed. (favorite is determined from a resource_user pivot table)
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

Chart widget not showing until page refresh
FilamentFFilament / ❓┊help
3y ago
Toggle-column
FilamentFFilament / ❓┊help
2y ago
grouped actions not working after downloading file until page is refreshed
FilamentFFilament / ❓┊help
2y ago
Toggle column issue.
FilamentFFilament / ❓┊help
3y ago