From aac6144db22768c780ab5a19c1441830254c6057 Mon Sep 17 00:00:00 2001 From: Dennis Smink Date: Mon, 10 Sep 2018 21:42:43 +0200 Subject: [PATCH] Ability to disable register route (#25556) --- src/Illuminate/Routing/Router.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Routing/Router.php b/src/Illuminate/Routing/Router.php index c3077b1035a4..c7e7ae2a4040 100644 --- a/src/Illuminate/Routing/Router.php +++ b/src/Illuminate/Routing/Router.php @@ -1149,8 +1149,10 @@ public function auth(array $options = []) $this->post('logout', 'Auth\LoginController@logout')->name('logout'); // Registration Routes... - $this->get('register', 'Auth\RegisterController@showRegistrationForm')->name('register'); - $this->post('register', 'Auth\RegisterController@register'); + if ($options['register'] ?? true) { + $this->get('register', 'Auth\RegisterController@showRegistrationForm')->name('register'); + $this->post('register', 'Auth\RegisterController@register'); + } // Password Reset Routes... $this->get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');