laravel 5.3 新 Auth::routes()

laravel 5.3 new Auth::routes()(laravel 5.3 新 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()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Convert JSON integers and floats to strings(将JSON整数和浮点数转换为字符串)
in php how do I use preg replace to turn a url into a tinyurl(在php中,如何使用preg替换将URL转换为TinyURL)
all day appointment for ics calendar file wont work(ICS日历文件的全天约会不起作用)
trim function is giving unexpected values php(Trim函数提供了意外的值php)
Basic PDO connection to MySQL(到MySQL的基本PDO连接)
PHP number_format returns 1.00(Php number_Format返回1.00)