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

sshateri's avatar

Check if the user completed registration

Hey everyone, I'm trying to implement a registration process that first, the user will register using email then they receive a confirmation email, and after confirming the email address they need to provide some info before they can see their profile or using the system. now I'm looking for the best way to check the third step and redirect them to the corresponding view which they can provide the needed info. currently, I'm using a function for this and calling it in the render method of the profile component which checks if they finished the 3rd step and if not then redirects them to the view that they can provide the extra info. I believe this is not the best way to handle this so that's why I'm asking the guru guys here for their opinions, suggestions, and possible solutions for handling this.

0 likes
3 replies
Nakov's avatar
Nakov
Best Answer
Level 73

I would create a middleware and apply it to the route group, so that all the endpoints are checked if the user finished that step. Because if you currently check for that in a controller, you will have to check on each controller the same thing, so that the user does not bypasses the info part.

https://laravel.com/docs/8.x/middleware

1 like
Atef95's avatar

Just create a middleware to protect the profile route .. Test on the authenticated user if he has fulfilled the data otherwise he gets redirected to nth step...

sshateri's avatar

Thanks for the solution. it's working perfectly.

Please or to participate in this conversation.