Disabled field through $set function not updating state
I used the Filament documentation (https://filamentphp.com/docs/3.x/forms/advanced#generating-a-slug-from-a-title) to automatically generate a slug based on a text field.
Like this:
As you can see I am disabling the slug TextInput, because I dont want users to be able to modify it as it automatically does that.
When I click on save I get an error that the slug column cannot be inserted in my database because the value is null. But it does have a value
If I remove the ->disabled() from the slug TextInput it does save fine.
2 Replies
You need to put
->dehydrated()
read more here https://filamentphp.com/docs/3.x/forms/fields/getting-started#disabling-a-fieldThanks! Works :)