F
Filament2w ago
Hedi

conditionally show editForm in Select

hello, i have a table that holds names, the user_id in the Name might be null which means it's a default Name, but users can create their own names and edit them. but i don't want the default names to be editable, how can i hide the editForm when the user_id is null? i haven't been able to come up with an idea
Select::make('name_id')
->relationship('name', 'name')
->editOptionForm([
Forms\Components\TextInput::make('name')
->required(),
]),
Select::make('name_id')
->relationship('name', 'name')
->editOptionForm([
Forms\Components\TextInput::make('name')
->required(),
]),
here's what i have so far, thanks in advance!
1 Reply
Matthew
Matthew2w ago
What about making the visibility of the edit fields dependent on the $record parameters yo u want, and then a reverse visibility of a placeHolder, explaining they cannot edit it.

Did you find this page helpful?