LoginController对vender中的登陆验证进行重写但是自定义表单验证不起作用(注释代码),错误信息两个都不起作用,只能改validate.php中的定义吗?
表单验证还没有尝试
顺便抱下大腿 验证码规则怎么定义?我用的accepted
谢谢
protected function validateLogin(Request $request)
{
$messages = [
'email.required' => '邮箱不能为空',
'password.required' => '密码不能为空',
'captcha.required' => '验证码验证失败',
];
// $validator = Validator::make($request->all(), [
// $this->username() => 'required|string',
// 'password' => 'required|string',
// 'captcha' => 'required|accepted',
// ], $messages);
$this->validate($request, [
$this->username() => 'required|string',
'password' => 'required|string',
'captcha' => 'required|accepted',
]);
exit;
}
茅侃侃
慕妹3242003