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

jaysen's avatar

Form Wizard - Best Practices

I'm trying to create a multi step form.

I'm considering setting up separate view resource for each step. This means I will have a view\step1 folder and then a step1Controller and all the various blade files show.blade.php, edit.blade.php, etc.

I will re-use the master layout across the steps.

Do I need to have separate folders and resource for each step, or what would be a better way?

0 likes
1 reply
davorminchorov's avatar

I'd name stuff by resource instead of step1, step2 so I can understand what's going on. Account Information is more descriptive than Step 1 and so on.

Example: Let's say that the form is for registration, I'll have a view for account information, credit card information, profile information etc so my folder structure will be something like:

views
    registration
        register.blade.php // the main form where every other blade template is included
        account.blade.php
        creditcard.blade.php
        profile.blade.php

When I set up the form, I'd just load these forms into sections of one form, and use something like JQuery Steps to move from step to step. When the steps are done, I'll post the data to a RegistrationController and do whatever needs to be done.

That's just one way of dealing with it, but it depends on your use case.

Please or to participate in this conversation.