如何自定义 php artisan ui vue --auth 文件

How to customize php artisan ui vue --auth files

晚上好,我只是想问一下,是否可以编辑您运行时生成的路由和其他文件 php artisan ui vue --auth

通过自定义我的意思是,注册是否可以在注册类似的东西时添加步骤,我只想问如何,每当我查看 routes/web。php 没有routes in registration but when I 运行 php artisan route:list 有,抱歉问你提前谢谢你,祝你有美好的一天谢谢你

Auth::routes(); 是 collection 条路线。其中包括路线:

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

如果您想更改默认的授权文件,您可以。您将在 Controllers/Auth 目录中找到所有控制器,在 resources/Auth 目录中找到 blade 文件。

如果你还是觉得很难。而不是在 Laravel auth 中进行更改!您可以从 routes/web.php 中删除 Auth::routes(); 并创建您自己的。

这是一个例子:

// Authentication Routes...
$this->get('login', 'LoginController@showLoginForm')->name('login');
$this->post('login', 'LoginController@login');
$this->post('logout', 'LoginController@logout')->name('logout');

// Registration Routes
$this->get('register', 'RegisterController@showRegistrationForm')->name('register');
$this->post('register', 'RegisterController@register');

// Password Reset Routes
$this->get('password/reset', 'ForgotPasswordController@showLinkRequestForm');
$this->post('password/email', 'ForgotPasswordController@sendResetLinkEmail');
$this->get('password/reset/{token}', 'ResetPasswordController@showResetForm');
$this->post('password/reset', 'ResetPasswordController@reset');