FilamentF
Filament3y ago
8 replies
3rgo

Ability to skip validation on form ?

Hey everyone !
I'm working on a custom page that contains a form. I need to have 2 actions at the bottom :
- a "save draft" action that performs the model update (even a partial one, ignoring empty fields), so ignoring the
required
rule
- a "submit" action that performs a total data validation and save
My save draft action is not on a submit button, but a regular one, with
wire:click="saveDraft"
, but I never reach the
dd
in that function, and validation fails on empty fields.
Any idea how I can go around the
required
rule when using this method ? Thanks !
Solution
validation is run when calling
$form->getState()
..
You can get the rawstate without validation
$form->getRawState()
Was this page helpful?