Php 如何覆盖Laravel 5.4中的身份验证路由

Php 如何覆盖Laravel 5.4中的身份验证路由,php,authentication,laravel-5.4,Php,Authentication,Laravel 5.4,我使用Auth::routes()用于路由身份验证 Defoult路由规则位于../vendor/laravel/framework/src/illusted/Routing/Router.php中,如下所示: public function auth() { // Authentication Routes... $this->get('login', 'Auth\LoginController@showLoginForm')->name('

我使用
Auth::routes()web.php
中的code>用于路由身份验证

Defoult路由规则位于
../vendor/laravel/framework/src/illusted/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');

但我不想更改供应商中的任何内容。

不要注册
路由::auth()
路由,并在
web.php
中分别注册每个路由。此外(但不要这样做),如果在注册路由后重新注册路由,它将覆盖上一个路由。请参见此处: