class ListRule implements Stringable (View source)

Properties

protected array $constraints

The additional constraints for the list rule.

Methods

between(int $min, int $max)

The field under validation must have between the given min and max number of items (inclusive).

exactly(int $value)

The field under validation must have exactly the given number of items.

max(int $value)

The field under validation must not have more than the given number of items.

min(int $value)

The field under validation must have at least the given number of items.

string
__toString()

Convert the rule to a validation string.

addRule(array|string $rules)

Add custom rules to the validation rules array.

Details

ListRule between(int $min, int $max)

The field under validation must have between the given min and max number of items (inclusive).

Parameters

int $min
int $max

Return Value

ListRule

ListRule exactly(int $value)

The field under validation must have exactly the given number of items.

Parameters

int $value

Return Value

ListRule

ListRule max(int $value)

The field under validation must not have more than the given number of items.

Parameters

int $value

Return Value

ListRule

ListRule min(int $value)

The field under validation must have at least the given number of items.

Parameters

int $value

Return Value

ListRule

string __toString()

Convert the rule to a validation string.

Return Value

string

protected ListRule addRule(array|string $rules)

Add custom rules to the validation rules array.

Parameters

array|string $rules

Return Value

ListRule