如何在Laravel 5.4中覆盖auth路由

问题描述 投票:3回答:0

我使用Auth::routes(); 在我的web.php进行路由验证。

Defoult路由规则位于.../vendor/laravel/framework/src/Illuminate/Routing/Router.php ,如下所示:

public function auth()
    {
        // Authentication Routes...
        $this->get('login', 'Auth\LoginController@showLoginForm')->name('login');
        $this->post('login', 'Auth\LoginController@login');
        $this->post('logout', 'Auth\LoginController@logout')->name('logout');

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

        // Password Reset Routes...
        $this->get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm');
        $this->post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
        $this->get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm');
        $this->post('password/reset', 'Auth\ResetPasswordController@reset');
    }

我需要覆盖此规则,例如:

$this->get('/admin/password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm');
$this->post('/admin/password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');

但我不想改变供应商的任何东西。

php authentication laravel-5.4
© www.soinside.com 2019 - 2024. All rights reserved.