Laravel 5.3登录路由-RouteCollection.php中的NotFoundHttpException

编程艺术

我正在尝试建立我的新项目,我正在使用 Laravel 5.3。我的问题是,auth 路由不能像预期的那样工作。我总是收到以下错误:

NotFoundHttpException in RouteCollection.php

我删除了新更新附带的 laravel auth 路由:

Those: Auth::routes();

并将它们替换为:

Route::group(['middleware' => ['web']], function() {
// Login Routes...
    Route::get('login', ['as' => 'login', 'uses' => 'Auth\LoginController@showLoginForm']);
    Route::post('login', ['as' => 'login.post', 'uses' => 'Auth\LoginController@login']);
    Route::post('logout', ['as' => 'logout', 'uses' => 'Auth\LoginController@logout']);

// Registration Routes...
    Route::get('register', ['as' => 'register', 'uses' => 'Auth\RegisterController@showRegistrationForm']);
    Route::post('register', ['as' => 'register.post', 'uses' => 'Auth\RegisterController@register']);

// Password Reset Routes...
    Route::get('password/reset', ['as' => 'password.reset', 'uses' => 'Auth\ForgotPasswordController@showLinkRequestForm']);
    Route::post('password/email', ['as' => 'password.email', 'uses' => 'Auth\ForgotPasswordController@sendResetLinkEmail']);
    Route::get('password/reset/{token}', ['as' => 'password.reset.token', 'uses' => 'Auth\ResetPasswordController@showResetForm']);
    Route::post('password/reset', ['as' => 'password.reset.post', 'uses' => 'Auth\ResetPasswordController@reset']);
});

好吧,现在我正在尝试使用它们,但是我总是得到提到的异常

我正在测试的网址:http://localhost/project/public/login

我不知道“公众”来自哪里.. 那是来自 xampp 或类似的东西..

所以这给了我错误。

如果我添加这条路线:

Route::get('/', 'Auth\LoginController@showLoginForm'); // 路由组的外部和内部

我被重定向到登录表单,一切都很好

如果我尝试:

Route::get('/test', 'Auth\LoginController@showLoginForm'); // 与 Route::get('test', ...) 相同

我也收到错误。有人有解决方案吗?

阿姆阿里

你不能像那样运行 Laravel 应用程序。你需要跑php artisan serve command

然后去 localhost:8000

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Laravel 5-RouteCollection.php第143行中的NotFoundHttpException

Laravel中RouteCollection.php中的NotFoundHttpException

RouteCollection.php中的Laravel 5.3 NotFoundHttpException

RouteCollection.php第161行中的NotFoundHttpException:在Laravel 5中

Laravel5:Redirect :: to()在RouteCollection.php中的NotFoundHttpException外部链接

Laravel5:RouteCollection.php第161行中的NotFoundHttpException

Laravel中RouteCollection.php第161行中的NotFoundHttpException

RouteCollection.php第161行中的Laravel 5.1 NotFoundHttpException:

RouteCollection.php第161行中的NotFoundHttpException:Laravel 5.3

RouteCollection.php第161行中的NotFoundHttpException laravel 5.2

在 Laravel 5.2 中使用附加控制器进行路由时,RouteCollection 中的 NotFoundHttpException

Laravel 5在RouteCollection.php第219行中的MethodNotAllowedHttpException:

RouteCollection.php第201行中的Laravel 5 MethodNotAllowedHttpException:

Laravel 5.4 中的 RouteCollection.php(第 179 行)中的 NotFoundHttpException

Laravel与WAMP服务器-Error,RouteCollection.php第161行中的NotFoundHttpException:

为什么在Laravel 5.3的RouteCollection.php第161行中没有NotFoundHttpException

laravel 5.2 NotFoundHttpException在RouteCollection.php第161行

Laravel路由:RouteCollection中的子文件夹和错误

RouteCollection获取在Laravel 5.6中不起作用的路由

Laravel 5:使用Route :: delete删除用户记录,在RouteCollection.php中获取MethodNotAllowedHttpException

Laravel 错误:RouteCollection.php 第 233 行中的 MethodNotAllowedHttpException

Laravel-RouteCollection.php第251行中的MethodNotAllowedHttpException

RouteCollection.php第218行中的Laravel MethodNotAllowedHttpException:

RouteCollection.php 中的 laravel 5.4 MethodNotAllowedHttpException(第 251 行)

为什么我在RouteCollection中收到NotFoundHttpException?

Controller.php第268行中的1/1 NotFoundHttpException:找不到控制器方法。在laravel 5中

Laravel 5添加回routes.php NotFoundHttpException

用角度2刷新后RouteCollection.php中的NotFoundHttpException吗?

如何解决 Laravel 5.3 中 RouteCollection.php 中的 MethodNotAllowedHttpException?