Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Kurai's avatar
Level 4

MultiStep Form

Hey Guys, i am creating a MultiStep form using Laravel and inertiaJS(React). i was wondering if anyone can give me some tips on approaching this problem, i been searching around the internet and found 2 options on tackling the problem, they are listen below:

Method 1: Store Data in the session on each step of the form. This allows me to have validations on each step, so there will be no reason to return to the previous page unless they want to edit the data. Only issue i see with this approaching is multiple pages being written and unique validation rule may not hold true if the user takes forever to submit the form.

Method 2: Store all the data in the client using React state and then conduct a single form submit once the users is in the last step. Issues i find with this is users will have to return back to previous steps if an error occurs on any step other than the last one. Refreshing page causes state to be lost.

Any tips would be nice, since i never done a multi stage form before.

1 like
2 replies
martinbean's avatar

@kurai If you’re using Inertia then you’re not really going to have a session. Instead, consider creating a model to represent the data your user is submitting.

So if it’s say, an application, then you could have a PendingApplication model. If the user is authenticated, then you can associate the model with the user, and then follow up with prompts to complete their application if it’s left unchanged for a period of time (say, 12 hours). The final step can be converting this “pending” model to the proper model.

1 like
nathanos's avatar

Hey @kurai Just wondering how you ended up going about this, as I'm in the same situation as you were :)

Please or to participate in this conversation.