I have the following Rule :
'Fno' => 'digits:10'
'Lno' => 'min:2|max5' // this seems invalid
但是怎样才能有这样的规则呢?
Fno应为最小2位到最大5位的数字,且
LNO应为至少包含2位数字的数字
I have the following Rule :
'Fno' => 'digits:10'
'Lno' => 'min:2|max5' // this seems invalid
但是怎样才能有这样的规则呢?
Fno应为最小2位到最大5位的数字,且
LNO应为至少包含2位数字的数字
If I correctly got what you want:
$rules = ['Fno' => 'digits_between:2,5', 'Lno' => 'numeric|min:2'];
or
$rules = ['Fno' => 'numeric|min:2|max:5', 'Lno' => 'numeric|min:2'];
所有可用规则:http://laravel.com/docs/4.2/validation#available-validation-rules
digits_between :min,max
要验证的字段的长度必须介于给定的最小值之间 和最大.
numeric
验证中的字段必须有一个数值.
max:value
验证字段必须小于或等于最大值 价值.字符串、数字和文件的计算方式相同 作为尺码规则.
min:value
The field under validation must have a minimum value. Strings, numerics, and files are evaluated in the same fashion as the size rule.