问题
Hello I am facing NotFoundHttpException error when i access /login or /register when i run the php artisan make:auth command, routes are also created their, but /login or /register is not working for me, let me share my code with you.
Web.php
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
when i check my browers concole its showing this error
GET http://localhost/laravel5authprc/login 404 (Not Found)
回答1:
Try to access http://localhost/laravel5authprc/index.php/login
If it works, then you need to set up a virtual Host in your apache vHosts file
回答2:
Probably something is NotFoundHttp...
I'd recommend:
Try:
Route::group([ 'prefix' => 'laravel5authprc' ], function () {
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
Route::get('/', 'HomeController@index')->name('home.alias');
});
来源:https://stackoverflow.com/questions/46050068/notfoundhttpexception-in-routecollection-php-line-179-in-laravel-5-4