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?
Solution:
Actually it would be visible(false) on the step
Jump to solution
9 Replies
LeandroFerreira
LeandroFerreira6mo ago
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-form
garethfrost
garethfrostOP6mo ago
this 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
toeknee
toeknee6mo ago
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?
garethfrost
garethfrostOP6mo ago
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
toeknee
toeknee6mo ago
No, how are you removed the last steps? disabled() should suffice
garethfrost
garethfrostOP6mo ago
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
toeknee
toeknee6mo ago
Actually it would be visible(false) on the step
toeknee
toeknee6mo ago
to be safe you could put the same condition on the fields too.
garethfrost
garethfrostOP6mo ago
thank you, the solution i have works for now but will give that a try in the future! FYI this works thanks!
Want results from more Discord servers?
Add your server