laravel 5.3 new Auth::routes()(laravel 5.3 新 Auth::routes())
问题描述
最近开始用laravel 5.3写博客,运行php artisan make:auth
Recently I start to use laravel 5.3 to write a blog, but I have a question after run php artisan make:auth
当我运行它时,它会在我的 web.php
when I run this, it will generate routes in my web.php
这是里面的代码:
Auth::routes();
Route::get('/home', 'HomeController@index');
然后我运行php artisan route:list
,我发现了很多动作,比如LoginController@login...
Then I run php artisan route:list
, I find lots of actions, like LoginController@login...
但是我在我的AppHttpControllersAuth
中没有找到这些操作,这些在哪?
But I didn't find these actions in my AppHttpControllersAuth
, where are these?
还有 Auth::routes()
代表什么,我找不到关于 Auth 的路由.
And also what is the Auth::routes()
stand for, I can't find the routes about Auth.
我需要别人的帮助,谢谢你回答我的问题
I need someone help, thank you to answer my question
推荐答案
Auth::routes()
只是一个帮助类,可帮助您生成用户身份验证所需的所有路由.你可以在这里浏览代码 https://github.com/laravel/framework/blob/5.3/src/Illuminate/Routing/Router.php 代替.
Auth::routes()
is just a helper class that helps you generate all the routes required for user authentication. You can browse the code here https://github.com/laravel/framework/blob/5.3/src/Illuminate/Routing/Router.php instead.
路线如下
// Authentication Routes...
$this->get('login', 'AuthLoginController@showLoginForm')->name('login');
$this->post('login', 'AuthLoginController@login');
$this->post('logout', 'AuthLoginController@logout')->name('logout');
// Registration Routes...
$this->get('register', 'AuthRegisterController@showRegistrationForm')->name('register');
$this->post('register', 'AuthRegisterController@register');
// Password Reset Routes...
$this->get('password/reset', 'AuthForgotPasswordController@showLinkRequestForm');
$this->post('password/email', 'AuthForgotPasswordController@sendResetLinkEmail');
$this->get('password/reset/{token}', 'AuthResetPasswordController@showResetForm');
$this->post('password/reset', 'AuthResetPasswordController@reset');
这篇关于laravel 5.3 新 Auth::routes()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:laravel 5.3 新 Auth::routes()
基础教程推荐
- PHP 守护进程/worker 环境 2022-01-01
- phpmyadmin 错误“#1062 - 密钥 1 的重复条目‘1’" 2022-01-01
- Doctrine 2 - 在多对多关系中记录更改 2022-01-01
- 如何在 Symfony 和 Doctrine 中实现多对多和一对多? 2022-01-01
- 如何在 XAMPP 上启用 mysqli? 2021-01-01
- 在 CakePHP 2.0 中使用 Html Helper 时未定义的变量 2021-01-01
- 在 yii2 中迁移时出现异常“找不到驱动程序" 2022-01-01
- HTTP 与 FTP 上传 2021-01-01
- 找不到类“AppHttpControllersDB",我也无法使用新模型 2022-01-01
- 使用 PDO 转义列名 2021-01-01