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