File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -228,8 +228,8 @@ class FieldValidation {
228228 return this ;
229229 }
230230
231- FieldValidation regExp ({String ? messages}) {
232- _rules.add ('reg_exp' );
231+ FieldValidation regExp (String rule, {String ? messages}) {
232+ _rules.add ('reg_exp:$ rule ' );
233233 if (messages != null ) {
234234 _messages['$fieldName .reg_exp' ] = messages;
235235 }
@@ -276,13 +276,8 @@ class FieldValidation {
276276 return this ;
277277 }
278278
279- @override
280- String toString () {
281- return _rules.join ('|' );
282- }
283-
284- FieldValidation unique (String table, String column, {String ? messages}) {
285- _rules.add ('unique:$table ,$column ' );
279+ FieldValidation unique (String table, {String ? messages}) {
280+ _rules.add ('unique:$table ,$fieldName ' );
286281 if (messages != null ) {
287282 _messages['$fieldName .unique' ] = messages;
288283 }
@@ -304,4 +299,9 @@ class FieldValidation {
304299 }
305300 return this ;
306301 }
302+
303+ @override
304+ String toString () {
305+ return _rules.join ('|' );
306+ }
307307}
You can’t perform that action at this time.
0 commit comments