如果有办法检查验证器是否由于唯一规则而特别失败?
原文链接:https://www.f2er.com/laravel/133632.html$rules = array( 'email_address' => 'required|email|unique:users,email','postal_code' => 'required|alpha_num',); $messages = array( 'required' => 'The :attribute field is required','email' => 'The :attribute field is required','alpha_num' => 'The :attribute field must only be letters and numbers (no spaces)' ); $validator = Validator::make(Input::all(),$rules,$messages); if ($validator->fails()) {
在外行人看来,我基本上想知道:“验证失败了,因为email_address不是唯一的吗?”