AbehoM's avatar

Multi step form and user registration for OLX kinda website

I want to remove the regular user registration from my Laravel setup. The idea is that someone will only have an account if he buy his way in. It's kinda like OLX (but paid) and instead of "register" he will see "create your ad" and that is where the multi step form comes in:

I thought about doing that way (as steps)

  1. The user type his regular information such as email and password (for regular registration)
  2. The user fills some information about his ad
  3. The user fills the payment information and make the payment (his account is put on hold until his payment is done)
  4. The user can log in

I have two questions:

  1. How can I do that multi step form?
  2. What can I do if the user do the first step, register his account but doesn't finish the other steps (like closing the browser?).

For the second question I thought about creating a field in the users table like finished or something like that that would be set to true once he finishes all the steps, this way I know that he have done all the steps, otherwise the next time he tries to access the website the form would appear in the next step (how to know in which step he finished? maybe instead of finished use last_step?)

Thank you.

0 likes
1 reply
ftiersch's avatar

I think you are approaching this too much from the "multi step form" angle.

Think of it from the database angle.

  1. User should be able to login. So what do you need? A users table to hold all users that can login. To fill that users table you need a registration (which is the same thing laravel already has basically).

  2. Users can have ads. Cool. So you probably need an ads table and a step to get an entry in that ads table for a user. Now you see: If you have an entry in the users table AND in the ads table he has at least finished step 2.

  3. Users need to pay. Probably you need to record those payments, see what has happened, maybe give them invoices and stuff. So you might need a payments table. And there you have it: if you have a users entry that has an ads entry that has a payments entry you have an active user.

Now if you don't want your user to be able to login until he has done all that you can have something like "active" in your users table and add that as a condition for a login and once the payment is finished you set that to "true".

So don't base everything around a "multi step form" - that's just presentation. You could have the same process in a one step form or without any form at all. Think of what data you need and then find a way to get that data that makes sense to the user.

Please or to participate in this conversation.