我必须对确认密码进行后端验证。我把我的验证器写成
$validator = Validator::make($request->all(), [
'first_name' => 'required',
'last_name' => 'required',
'email' => 'email|required',
'password' => 'required',
'confirm_password' => 'required',
'tnc' => 'required'
]);
现在确认密码必须与密码字段相同。我们可以用laravel验证器吗?
答案 0 :(得分:3)
'password' => 'required|min:6|confirmed',
'confirm_password' => 'required|min:6|confirmed',
试试这个