disable field dynamically but save it in db
Hi, I need to dynamically disable a Togglebut I have to save the field: how come it doesn’t work ?
Solution:Jump to solution
Perfect !!
```php
Forms\Components\Toggle::make('is_contraente')
->default($is_contraente)
->disabled($is_contraente_disabled)...
4 Replies
Because
disabled()
feels aren't savedOk, but with ->dehydrated() ??
Not sure whether that works. But you specified
disabled()
after dehydrated()
so it's overwritten again.Solution
Perfect !!
Thanks