If the fields in the form are not filled out, ignore those fields during the entry process. #15299
-
PackageForm builder Package Versionv3.2.0 How can we help you?sql
filament Forms\Components\TextInput::make("title"), If I ignore the field title when submitting the form, I expect it to be added to the database smoothly. However, in reality, the title is also submitted as null, which conflicts with the not null constraint of the title. I tried adding default(''), but it still submits null. May I ask if there are any other solutions without changing the table field and while still enforcing the submission of the title? |
Beta Was this translation helpful? Give feedback.
Answered by
leandrocfe
Jan 9, 2025
Replies: 1 comment 1 reply
-
Try ->dehydrateStateUsing(fn (string $state): string => $state ?? '') |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
shaco-go
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try