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
field when the
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),
            ]);
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')
Was this page helpful?