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

dmytroshved's avatar

Need a help with Step-By-Step Form which has Dynamic Input Fields

Hi, I have a question. I'm creating a step-by-step form using Laravel & Livewire 3, and this form will be used for creating a recipe.

An approximate structure of Dynamic Input Fields:

This form will have three steps:

  1. Recipe info
  2. Ingredients
  3. Instruction info

Steps 2 and 3 will have dynamic input fields. For example, in the Ingredients step, users will be able to create multiple blocks (each block will allow them to enter data for one ingredient), so they can add multiple ingredients. Similarly, in the Instruction step, users will be able to dynamically create multiple input field blocks where they can enter step-by-step instructions for the recipe.

My question is: Should I implement the logic for dynamic input fields in separate Livewire components?

Since the entire step-by-step form will be in one component, I need a way to retrieve data from steps 2 and 3. But if I create steps 2 and 3 as separate Livewire components, I’m not sure how to access the data from these steps when I need to retrieve the request data from the entire form.

So, my main question is: Should I handle everything in a single component, or should I create separate Livewire components for the dynamic input fields and then include them in the step-by-step form?

Could you please clarify this for me?

1 like
1 reply
vincent15000's avatar

If you have a multi step form, you can store the intermediate datas in the session.

And when you are on the last step to save all datas in the database, you can retrieve the intermediate datas from the session.

1 like

Please or to participate in this conversation.