Skip to content
Advertisement

how to resolve Redirection in laravel8?

The route is not redirecting the specified route in laravel8.

Here is my code that is defined in web.php:

Route::get('/', function () {
   return redirect()->route('login');
});

After hitting ‘/’, I need to redirect to this route:

Route::get('login', 'LoginController@login')->name('login');

I was getting an error:

The GET method is not supported for this route. Supported methods: HEAD.

How to resolve this?

Advertisement

Answer

Try this to clear the cache:

php artisan optimize:clear
php artisan route:clear

Refs: https://github.com/laravel/framework/discussions/34512#discussioncomment-564416

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement