© 2026 Hedgehog Software, LLC

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

Reactive ->live() not updating ->helperText and/or ->label() values

Title says it all - my code below, am I missing something blindingly obvious? I'd expect the title and helper text to update on the
title
title
field when the
type
type
field changes.

return $form
            ->schema([
                Select::make('type')
                    ->options(MenuItemTypes::class)
                    ->live()
                    ->disabled(fn (?string $operation) => $operation === 'edit')
                    ->required()
                    ->helperText('Either add a single entry like a recipe or add mulitple options to choose from. This option can\'t be changed once set'),
        
                Toggle::make('is_active')
                    ->default(0),

                TextInput::make('title')
                    ->label(fn (Get $get): string => ($get('type') == MenuItemTypes::OPTIONS) ? 'Options title' : 'Title')
                    ->helperText(fn(Get $get): ?string => ($get('type') == MenuItemTypes::OPTIONS) ? 'e.g. Choose 3 from the following options' : '')
                    ->required()
                    ->maxLength(255),
            ]);
return $form
            ->schema([
                Select::make('type')
                    ->options(MenuItemTypes::class)
                    ->live()
                    ->disabled(fn (?string $operation) => $operation === 'edit')
                    ->required()
                    ->helperText('Either add a single entry like a recipe or add mulitple options to choose from. This option can\'t be changed once set'),
        
                Toggle::make('is_active')
                    ->default(0),

                TextInput::make('title')
                    ->label(fn (Get $get): string => ($get('type') == MenuItemTypes::OPTIONS) ? 'Options title' : 'Title')
                    ->helperText(fn(Get $get): ?string => ($get('type') == MenuItemTypes::OPTIONS) ? 'e.g. Choose 3 from the following options' : '')
                    ->required()
                    ->maxLength(255),
            ]);
Solution
the values of the select
single,options

so change the condetion to

 ->label(fn (Get $get): string => ($get('type') == MenuItemTypes::OPTIONS->value) ? 'Options title' : 'Title')
 ->label(fn (Get $get): string => ($get('type') == MenuItemTypes::OPTIONS->value) ? 'Options title' : 'Title')
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Form Component Toggle live or reactive() not working
FilamentFFilament / ❓┊help
3y ago
`->live()` Not working as `->reactive()`
FilamentFFilament / ❓┊help
3y ago
reactive() vs live()
FilamentFFilament / ❓┊help
3y ago
Reactive filter updating
FilamentFFilament / ❓┊help
2y ago