File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ and "50", you might add the following:
42
42
* min = 2,
43
43
* max = 50,
44
44
* minMessage = "Your first name must be at least {{ limit }} characters long",
45
- * maxMessage = "Your first name cannot be longer than {{ limit }} characters"
45
+ * maxMessage = "Your first name cannot be longer than {{ limit }} characters",
46
+ * allowEmptyString = true
46
47
* )
47
48
*/
48
49
protected $firstName;
@@ -59,6 +60,7 @@ and "50", you might add the following:
59
60
max : 50
60
61
minMessage : ' Your first name must be at least {{ limit }} characters long'
61
62
maxMessage : ' Your first name cannot be longer than {{ limit }} characters'
63
+ allowEmptyString : true
62
64
63
65
.. code-block :: xml
64
66
@@ -79,6 +81,7 @@ and "50", you might add the following:
79
81
<option name =" maxMessage" >
80
82
Your first name cannot be longer than {{ limit }} characters
81
83
</option >
84
+ <option name =" allowEmptyString" >true</option >
82
85
</constraint >
83
86
</property >
84
87
</class >
@@ -101,6 +104,7 @@ and "50", you might add the following:
101
104
'max' => 50,
102
105
'minMessage' => 'Your first name must be at least {{ limit }} characters long',
103
106
'maxMessage' => 'Your first name cannot be longer than {{ limit }} characters',
107
+ 'allowEmptyString' => true,
104
108
]));
105
109
}
106
110
}
You can’t perform that action at this time.
0 commit comments