laravel5 auth 验证路由如何重写

2016-06-24 17:25:33 +08:00
 deewu

刚刚接触 laravel ,使用 auth 验证用户登录态时,跳转登录都是指向默认路由 下面是 laravel 默认的路由 public function auth() { // Authentication Routes... $this->get('login', 'Auth\AuthController@showLoginForm'); $this->post('login', 'Auth\AuthController@login'); $this->get('logout', 'Auth\AuthController@logout');

    // Registration Routes...
    $this->get('register', 'Auth\AuthController@showRegistrationForm');
    $this->post('register', 'Auth\AuthController@register');

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

我想改下这些路由,例如 login 改成 admin/login,请教能不能改,怎样修改

2456 次点击
所在节点    PHP
1 条回复
whahuzhihao
2016-06-24 18:43:14 +08:00
Route::group(['prefix' => '/admin',], function(){
Route::auth();
});

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/288091

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX