如何填写邮件验证字段?

时间:2019-07-30 06:01:59

标签: laravel

当我在Laravel注册会员时,我会发送一封确认电子邮件。但是,当我单击验证链接时,数据库中的列没有填充。

示例代码:

protected function create(array $data)
{
    $user = User::create([
        'first_name' => $data['first_name'],
        'last_name' => $data['last_name'],
        'email' => $data['email'],
        'phone' => $data['phone'],
        'password' => Hash::make($data['password']),
    ]);

    $user->sendEmailVerificationNotification();

    return $user;
}

public function register(Request $request)  {
    $validation = $this->validator($request->all());

    if($request->input('type') == "customer" || $request->input('type') == "company") {
        if ($validation->fails())  {
            return response()->json([$validation->errors()->toArray()], 400);
        }else {
            $this->create($request->all());
        }
    }else {
        return response()->json([
            0 => ['Üyelik sırasında bir hata oluştu. Lütfen tekrar deneyiniz.']
        ], 404);
    }
}

1 个答案:

答案 0 :(得分:0)

1)运行auth样板后是否迁移了表? 2)您是否检查过日志是否可能显示其他错误?