Conditionally create non-editable fields

There are a function that create a "TextInput" no editable for the user? I would like to send "generated" data based on others fields, then, put it at non editable field like *username * based on real user name. Disabled fields cannot be sent due to their own disabled status. How can I achieve this function?
Solution:
See use of dehydrated() in the docs on disabling. A field which is ->disabled()->dehdrated() will be submitted with the form. If you are worried about people spoofing it, you can always re-create the value from your other fields on save with a dehydrateStateUsing() method. https://filamentphp.com/docs/3.x/forms/fields/getting-started#disabling-a-field...
Jump to solution
2 Replies
Solution
cheesegrits
cheesegrits14mo ago
See use of dehydrated() in the docs on disabling. A field which is ->disabled()->dehdrated() will be submitted with the form. If you are worried about people spoofing it, you can always re-create the value from your other fields on save with a dehydrateStateUsing() method. https://filamentphp.com/docs/3.x/forms/fields/getting-started#disabling-a-field
Altffenser
AltffenserOP14mo ago
Thank you! you're right! I take a look at it
Want results from more Discord servers?
Add your server