V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
deewu
V2EX  ›  PHP

laravel5 auth 验证路由如何重写

  •  
  •   deewu · 2016-06-24 17:25:33 +08:00 · 2453 次点击
    这是一个创建于 2865 天前的主题,其中的信息可能已经有所发展或是发生改变。

    刚刚接触 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,请教能不能改,怎样修改

    whahuzhihao
        1
    whahuzhihao  
       2016-06-24 18:43:14 +08:00
    Route::group(['prefix' => '/admin',], function(){
    Route::auth();
    });
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5709 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 02:56 · PVG 10:56 · LAX 19:56 · JFK 22:56
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.