加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

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

发布时间:2020-12-14 19:46:02 所属栏目:大数据 来源:网络整理
导读:运行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','AuthAuthController@showLoginForm');
$this->post('login','AuthAuthController@login');
$this->get('logout','AuthAuthController@logout');

// Password Reset Routes...
$this->get('password/reset/{token?}','AuthPasswordController@showResetForm');
$this->post('password/email','AuthPasswordController@sendResetLinkEmail');
$this->post('password/reset','AuthPasswordController@reset');

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读