I have the following Rule :
'Fno' => 'digits:10' 'Lno' => 'min:2|max5' // this seems invalid
But How to have the Rule that
Fno Should be a Digit with Minimum 2 Digit to Maximum 5 Digit and
Lno Should be a Digit only with Min 2 Digit
欢迎各位兄弟 发布技术文章
这里的技术是共享的
15 5 | I have the following Rule : 'Fno' => 'digits:10' 'Lno' => 'min:2|max5' // this seems invalid But How to have the Rule that Fno Should be a Digit with Minimum 2 Digit to Maximum 5 Digit and Lno Should be a Digit only with Min 2 Digit |
add a comment |
28 | 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']; 整数的话 当然可以使用 $rules = ['Fno' => 'integer|min:2|max:5', 'Lno' => 'integer|min:2']; 再加个 not_in:2 这样就不等于最小值 2 了 For all the available rules: http://laravel.com/docs/4.2/validation#available-validation-rules
|
3 Just adding one more validation type digits:value.The field under validation must be numeric and must have an exact length of value.[laravel.com/docs/5.0/validation#rule-digits] – Bugfixer Jul 25 '16 at 6:20 |
来自 https://stackoverflow.com/questions/27614936/laravel-rule-validation-for-numbers