how to defer expensive api call in form Wizard step
I'm using the form wizard, example in my step 1, there are some options for user select (which already has default values)
Then in step 2, I use these options to call expensive api call.
But it seem the api already call in the step one, even the step 2 not render yet.
Any one has solution for this situation like this, thank you so much
4 Replies
Without seeing the code that is causing your problem, we won't be able to identify the error.
same issue
the request send before enter in the last step
Because all steps are loaded (but only one is shown). Maybe not use a step lifecycle hook to call the api, explained here: https://filamentphp.com/docs/3.x/forms/layout/wizard#step-lifecycle-hooks
So use afterValidation on the step before and call the api there.