Support the ongoing development of →
Input Session Forms
Last updated 1 year ago.

I just implemented something similar in a project I am working on.

Our solution is to have a post route without an auth filter that validates the data so we can redirect back with errors (if failed) before showing the login form. If the validation is successful, we put the data from the form into a session attribute then redirect to the login form.

After the user logs in, we check for this session attribute. If it exists, we redirect them to the next stage (in our case a larger form with some info prefilled, but you could redirect to a route that handles the submission). This next stage route (with auth filter) checks for the existence of the session attribute (so an authenticated can't access the page without having filled in the previous form) then retrieves the data from the session and continues as if the first form was submitted to it.

Typed this out on my iPad so I hope it makes sense.

Last updated 1 year ago.

Thanks a lot, I also thought that was the only way to achieve this !

Last updated 1 year ago.

Sign in to participate in this thread!


Your banner here too?

JonathanWi jonathanwi Joined 31 Mar 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 - All rights reserved.