My web.php file looks like this:
Route::get('/login', 'AutenticacaoController@login')->name('autenticacao.login');
Route::post('/logar', 'AutenticacaoController@logar')->name('autenticacao.logar');
Route::resource('autenticacao', 'AutenticacaoController');
Route::middleware(['auth'])->group(function(){
Route::get('/', 'MunicipioController@inicio')->name('inicio');
Route::get('/logout', 'AutenticacaoController@logout')->name('autenticacao.logout');
Route::resource('municipios', 'MunicipioController');
});
If I access the route localhost/login
, I get good access, but if I access localhost/
, I get the error:
Route [login] not defined.
What could be wrong?
The idea is that, when accessing localhost/
, it is redirected to localhost/login