如果您查看文件app / Services / Registrar.php,您会在其中找到一个创建函数:
public function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
}
您需要修改此函数以包含表单字段.它们将在$data数组中传递.
该文件中还有一个验证器函数,用于将验证规则应用于您的字段.
此外,app / User.php模型文件中有一个受保护的$fillable数组.您需要将自定义字段名称添加到此数组,以便它们可以批量分配.
protected $fillable = ['name', 'email', 'password'];
2015年7月9日编辑
这适用于v5.0.1.文件夹结构已经发生了变化. app / Services / Registrar.php文件中的设置已移至app / Http / Controllers / Auth / AuthController.php