1

I have installed Laravel and set up authentication and I have also created a route group like this:

// users that want to access test route should be logged in. 
Route::group(['middleware' => ['web', 'auth']], function () {
    Route::get('first', function () {
        return 'first';
    });
});

The problem is when I access the route like this:

http://localhost/first

I can see my "first" message, but when I refresh the same page laravel redirects me to:

http://localhost/home

I could not solve this and I have moved my first route out of the route group now everything is working well. If I keep it in the route group with auth & web middlewares it is not working.

haakym
  • 12,050
  • 12
  • 70
  • 98
Vijayanand Premnath
  • 3,415
  • 4
  • 25
  • 42

1 Answers1

1

Try to remove web middleware if you're using 5.2.27 and higher.

Community
  • 1
  • 1
Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279