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

痞子三分冷 提交于 2019-12-13 00:54:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!