FilamentF
Filament3y ago
Veur

Determine Toggle label by state

Is there a way to change the label of a \Filament\Forms\Components\Toggle based on its value?
This is what I tried, but it doesn't work:

Toggle::make('active') ->label(fn ($record) => $record->active ? 'Active' : 'Inactive')
Was this page helpful?