© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•14mo ago•
4 replies
HirryBirry

ToggleButtons: Click to untoggle

Hi, I have a ToggleButtons-Component set up with an Enum-class. Is there a way to "untoggle" an already selected togglebutton. The desired result is that the delivery_method is set to null in the db.

ToggleButtons::make('delivery_method')
                            ->hiddenLabel()
                            ->options(DeliveryMethod::class)
                            ->reactive()
                            ->inline()
                            ->afterStateUpdated(function (string $state, Retouche $record): void {
                                $record->update([
                                    'delivery_method' => $state,
                                ]);

                                // Optionally notify the user
                                Notification::make()
                                    ->title('Delivery method updated')
                                    ->success()
                                    ->send();
                            }),
ToggleButtons::make('delivery_method')
                            ->hiddenLabel()
                            ->options(DeliveryMethod::class)
                            ->reactive()
                            ->inline()
                            ->afterStateUpdated(function (string $state, Retouche $record): void {
                                $record->update([
                                    'delivery_method' => $state,
                                ]);

                                // Optionally notify the user
                                Notification::make()
                                    ->title('Delivery method updated')
                                    ->success()
                                    ->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

ToggleButtons are requiring a double-click to change their state
FilamentFFilament / ❓┊help
16mo ago
[Solved]ToggleButtons
FilamentFFilament / ❓┊help
3y ago
Togglebuttons selects everything
FilamentFFilament / ❓┊help
2y ago
ToggleButtons default not working
FilamentFFilament / ❓┊help
14mo ago