The route is not redirecting the specified route in laravel8.
Here is my code that is defined in web.php:
JavaScript
x
Route::get('/', function () {
return redirect()->route('login');
});
After hitting ‘/’, I need to redirect to this route:
JavaScript
Route::get('login', 'LoginController@login')->name('login');
I was getting an error:
JavaScript
The GET method is not supported for this route. Supported methods: HEAD.
How to resolve this?
Advertisement
Answer
Try this to clear the cache:
JavaScript
php artisan optimize:clear
php artisan route:clear
Refs: https://github.com/laravel/framework/discussions/34512#discussioncomment-564416