ArrayRule
class ArrayRule implements Stringable
Properties
| protected array | $keys | The accepted keys. |
|
| protected array | $constraints | The additional constraints for the array rule. |
Methods
Create a new array rule instance.
The field under validation must have between the given min and max number of items (inclusive).
The field under validation must have exactly the given number of items.
The field under validation must not have more than the given number of items.
Convert the rule to a validation string.
Convert the rule to an array of validation rules.
Get the array rule with its accepted keys.
Details
at line 28
__construct(mixed $keys = null)
Create a new array rule instance.
at line 43
ArrayRule
between(int $min, int $max)
The field under validation must have between the given min and max number of items (inclusive).
at line 51
ArrayRule
exactly(int $value)
The field under validation must have exactly the given number of items.
at line 61
ArrayRule
max(int $value)
The field under validation must not have more than the given number of items.
at line 69
ArrayRule
min(int $value)
The field under validation must have at least the given number of items.
at line 77
string
__toString()
Convert the rule to a validation string.
at line 87
array
toArray()
Convert the rule to an array of validation rules.
at line 95
protected string
arrayRule()
Get the array rule with its accepted keys.
at line 112
protected ArrayRule
addRule(array|string $rules)
Add custom rules to the validation rules array.