php – 从Laravel身份验证中排除路由

php – 从Laravel身份验证中排除路由,第1张

概述运行php artisan后make:auth所有必需的路由都在route.php文件中,但是有可能删除一个(我想删除注册路由)? 目前我有 Route::group(['middleware' => 'web'], function () { Route::auth();}); 我知道Route :: auth()是添加所有路由的快捷方式. 我应该自己指定路线而不是使用快捷方式吗? 不 运行PHP artisan后make:auth所有必需的路由都在route.PHP文件中,但是有可能删除一个(我想删除注册路由)?

目前我有

Route::group(['mIDdleware' => 'web'],function () {    Route::auth();});

我知道Route :: auth()是添加所有路由的快捷方式.
我应该自己指定路线而不是使用快捷方式吗?

不幸的是,你不能排除注册与当前的 Route::auth()实现.

您必须手动指定所有路由

// Authentication Routes...$this->get('login','Auth\AuthController@showLoginForm');$this->post('login','Auth\AuthController@login');$this->get('logout','Auth\AuthController@logout');// Password reset Routes...$this->get('password/reset/{token?}','Auth\PasswordController@showresetForm');$this->post('password/email','Auth\PasswordController@sendresetlinkEmail');$this->post('password/reset','Auth\PasswordController@reset');

我认为这是一个相当普遍的事情,想要这样做会很好,如果auth方法有一个参数说没有寄存器也许你可以向项目提交拉动请求.

总结

以上是内存溢出为你收集整理的php – 从Laravel身份验证中排除路由全部内容,希望文章能够帮你解决php – 从Laravel身份验证中排除路由所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/langs/1261233.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-08
下一篇 2022-06-08

发表评论

登录后才能评论

评论列表(0条)

保存