Laravel 5: How to stay on the same page after login?

I have been google it and find a few ways to do it. But I think the method below is the quicker way.

You can modify your route in routes.php like this:


Route::get( 'page-slub'
'middleware' => 'auth',   // so it will required authentication
'uses' => 'yourPageControllerClass@handler'
);

That’s it. All you need is the add the “middleware” authentication into your Route. Then it should redirect you back to the previous page after the login.

Hope this help.

Leave a Reply

Name *
Email *
Website