2
我想在laravel5表单验证错误消息中设置自定义的提交名称。在laravel5表单验证中为字段设置自定义验证消息?
我form validation request class
是,
class PasswordRequest extends Request {
protected $rules = [
'old' => ['required'],
'new' => ['required','same:cnew'],
'cnew' => ['required']
];
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize() {
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules() {
return $this->rules;
}
}
这里的时候,老,新和cnew emty,错误信息会像下面,需要
- 老场。
- 新字段是必填字段。
- 需要cnew字段。需要
我想显示像下面而不是上面的消息,
- 旧密码字段
- 新密码字段需要
- 确认密码字段是必需的。
如何在laravel5 Form Request Validation方法中可能?
这是需要的,谢谢:) – gsk