laravel 5.2将数据传递到注册视图 [英] laravel 5.2 pass data to registration view
本文介绍了laravel 5.2将数据传递到注册视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是laravel 5.2,我编写了以下命令来自动添加身份验证的路由和视图:
I'm using laravel 5.2 and I wrote this command to automatically add routes and views of authentication:
php artisan make:auth
现在,我想将数据传递到注册视图,但是我找不到在哪里执行的操作,我假设它应该使用这样的代码:
Now I want to pass data to registration view but I don't find where to do that, I assume that it should be with a code like that:
Route::get('register', 'Auth\AuthController@showRegistrationForm');
但是在routes.php
中我有这个:
Route::auth();
Auth\AuthController
中只有两种方法:
- 验证器
- 创建
推荐答案
此文件中的注册用户类
\vendor\laravel\framework\src\Illuminate\Foundation\Auth\RegistersUsers.php
在laravel 5.2的身份验证控制器中,您会看到
In laravel 5.2 in auth controller you see
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
在此文件中,请参见
use AuthenticatesUsers, RegistersUsers {
AuthenticatesUsers::redirectPath insteadof RegistersUsers;
AuthenticatesUsers::getGuard insteadof RegistersUsers;
}
并且RegistersUsers类在
and RegistersUsers class is in
\vendor\laravel\framework\src\Illuminate\Foundation\Auth\RegistersUsers.php
如果使用phpstorm ide,则可以转到类名,然后按Ctrl +左键单击 和phpstorm打开您的课程.
If you use phpstorm ide you can go to the class name and press ctrl + left click and php storm open your class .
这篇关于laravel 5.2将数据传递到注册视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文