简体   繁体   中英

NotFoundHttpException in RouteCollection.php (line 179) in Laravel 5.4

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)

尝试访问http://localhost/laravel5authprc/index.php/login如果可行,则需要在apache vHosts文件中设置虚拟主机

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');


});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM