Как сказал Марк Дэвидсон, это невозможно из коробки. Но так я справлялся.
Теперь это может быть излишним, но я передаю массив того, что необходимо. Если параметры не переданы, создаются маршруты по умолчанию.
// Include the authentication and password routes
Route::auth(['authentication', 'password']);
/**
* Register the typical authentication routes for an application.
*
* @param array $options
* @return void
*/
public function auth(array $options = [])
{
if ($options) {
// Authentication Routes...
if (in_array('authentication', $options)) {
$this->get('login', 'Auth\[email protected]');
$this->post('login', 'Auth\[email protected]');
$this->get('logout', 'Auth\[email protected]');
}
// Registration Routes...
if (in_array('registration', $options)) {
$this->get('register', 'Auth\[email protected]');
$this->post('register', 'Auth\[email protected]');
}
// Password Reset Routes...
if (in_array('password', $options)) {
$this->get('password/reset/{token?}', 'Auth\[email protected]');
$this->post('password/email', 'Auth\[email protected]');
$this->post('password/reset', 'Auth\[email protected]');
}
} else {
// Authentication Routes...
$this->get('login', 'Auth\[email protected]');
$this->post('login', 'Auth\[email protected]');
$this->get('logout', 'Auth\[email protected]');
// Registration Routes...
$this->get('register', 'Auth\[email protected]');
$this->post('register', 'Auth\[email protected]');
// Password Reset Routes...
$this->get('password/reset/{token?}', 'Auth\[email protected]');
$this->post('password/email', 'Auth\[email protected]');
$this->post('password/reset', 'Auth\[email protected]');
}
}
В вашем случае, вероятно, можно просто передать boolean
в качестве параметра вместо array
. Если логическое значение: true
, то не загружайте маршруты register
, иначе загрузите все.
Надеюсь, что это поможет.