3

I use Auth::routes(); in my web.php for routing authentication.

Defoult routes rules are located in .../vendor/laravel/framework/src/Illuminate/Routing/Router.php and looks like this:

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

I need to overwrite this rules for example:

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

but I do not want to change anything in vendor.

Tomasz
  • 1,368
  • 3
  • 17
  • 31
  • 2
    Don't register the `Route::auth()` routes and register each one individually in your `web.php` . Also (but don't do this) if you re-register a route after it's been registered it overwrites the previous one. – apokryfos Mar 15 '17 at 12:28
  • see here: http://stackoverflow.com/questions/42695917/laravel-5-4-disable-register-route/42700000#42700000 – dparoli Mar 16 '17 at 15:43

0 Answers0