最近开始用laravel 5.3写博客,但是运行后有个问题php artisan make:auth
当我运行它时,它会在我的 web.php
这是其中的代码:
Auth::routes();
Route::get('/home', 'HomeController@index');
然后我运行php artisan route:list
,我发现很多 Action ,比如LoginController@login...
但是我的App\Http\Controllers\Auth
中没有找到这些 Action ,这些在哪里?
还有 Auth::routes()
代表什么,我找不到关于 Auth 的路由。
我需要帮助,谢谢你回答我的问题
最佳答案
Auth::routes()
只是一个帮助类,可帮助您生成用户身份验证所需的所有路由。您可以在这里浏览代码 https://github.com/laravel/framework/blob/5.3/src/Illuminate/Routing/Router.php而是。
这里是路线
// 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');
关于php - laravel 5.3 新的 Auth::routes(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39196968/