We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c72b7b3 + 1949a7b commit d2397edCopy full SHA for d2397ed
README.md
@@ -570,12 +570,23 @@ $v->validate();
570
571
```php
572
['users.*.id', 'each', 'required', 'isEmpty' => function($value) {
573
- if ($value instanceof \Inhere\Validate\ArrayValueNotExists) {
+ if ($value instanceof \Inhere\Validate\Exception\ArrayValueNotExists) {
574
return true;
575
}
576
// your code here ...
577
}]
578
```
579
+规则包含 .* 时的自定义验证,如: users.*.id
580
+```php
581
+['users.*.id', 'string', 'isEmpty' => function(array $value) {
582
+ foreach ($value as $item) {
583
+ if ($item instanceof \Inhere\Validate\Exception\ArrayValueNotExists) {
584
+ return true;
585
+ }
586
+ // your code here ...
587
588
+}]
589
+```
590
591
### `filter` -- 使用过滤器
592
0 commit comments