laravel 5.3新增Auth :: routes() [英] laravel 5.3 new Auth::routes()

查看:47
本文介绍了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...

但是我没有在我的App\Http\Controllers\Auth中找到这些动作,这些动作在哪里?

But I didn't find these actions in my App\Http\Controllers\Auth, 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', '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');

这篇关于laravel 5.3新增Auth :: routes()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆