Jak powiedział Mark Davidson, nie jest to możliwe po wyjęciu z pudełka. Ale tak właśnie się postarałem.
Teraz może to być przesada, ale przekazuję cały szereg potrzebnych informacji. Jeśli nie zostaną przekazane żadne parametry, tworzone są domyślne trasy.
// 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]');
}
}
Twoim przypadku można chyba tylko zdać boolean
jako parametr zamiast na array
. Jeśli wartość logiczna to true
, nie ładuj tras register
, w przeciwnym razie załaduj wszystko.
Mam nadzieję, że to pomaga.