protected $rule = [
'name' => 'require|max:50',
'sort' => 'number|max:10',
'status' => 'number|between:0,1|length:1',
];
protected $message = [
'name.require' => '分类名称必须填写',
'name.max' => '分类名称最多不能超过50个字符',
'sort.number' => '信息排序必须为数字',
'sort.max' => '信息排序最多不能超过10个字符',
'status.number' => '信息状态必须为数字',
'status.between' => '信息状态必须为0或1',
'status.length' => '信息状态必须为1个字符',
];
'name' => 'require|max:50', 已经定义最大50个字符
但是输入中文的时候 不到20个字符就说字符超过了50,有什么办法解决吗? 还是官方BUG。
最佳答案