Save wizard form without all steps completed
I have a wizard with 8 steps and the last 2 steps are restricted to a higher level of user.
Im having an issue where if a regular user completes the first 6 steps and clicks create, the form is not saving - is it possible for the form to be saved at step 6 and then the high user can edit steps 7 and 8?
9 Replies
I think you are using only the Form builder, right?
Did you add
$this->form->fill()
in the mount method and add a statePath?
https://filamentphp.com/docs/3.x/forms/adding-a-form-to-a-livewire-component#adding-the-formthis is on the main resources so as far as im aware there is no need for the mount method? (correct me if i am wrong) the issue is submitting the form requires all of the wizard steps to be complete
What is in step 7/8 is it a requirement on the model? you may have fields not saving to the db and the db doesn't support null values?
they are steps for management to basically approve the record, they are nullable in the DB.
Does the skipable function accept callback where i can define what steps can be skipped? - I have extracted out the last to steps to be on their own page so its not an issue anymore but would be good to know if this is possible for the future
No, how are you removed the last steps? disabled() should suffice
I have moved the last steps into a custom page so they arent part of the wizard anymore - is that disabled on the wizard step or on the fields?
Solution
Actually it would be visible(false) on the step
to be safe you could put the same condition on the fields too.
thank you, the solution i have works for now but will give that a try in the future!
FYI this works thanks!