Numeric
class Numeric implements Stringable (View source)
Traits
Properties
protected | $constraints | The constraints for the number rule. |
Methods
Apply the callback if the given "value" is (or resolves to) truthy.
Apply the callback if the given "value" is (or resolves to) falsy.
The field under validation must have a size between the given min and max (inclusive).
The field under validation must contain the specified number of decimal places.
The integer under validation must between the given min and max number of digits.
The field under validation must be greater than the given field or value.
The field under validation must be greater than or equal to the given field or value.
The field under validation must be less than or equal to the given field.
The field under validation must be less than or equal to a maximum value.
The field under validation must be a multiple of the given value.
Convert the rule to a validation string.
Details
$this|TWhenReturnType
when($value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
$this|TUnlessReturnType
unless($value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
Numeric
between(int|float $min, int|float $max)
The field under validation must have a size between the given min and max (inclusive).
Numeric
decimal(int $min, int|null $max = null)
The field under validation must contain the specified number of decimal places.
Numeric
digitsBetween(int $min, int $max)
The integer under validation must between the given min and max number of digits.
Numeric
greaterThan(string $field)
The field under validation must be greater than the given field or value.
Numeric
greaterThanOrEqualTo(string $field)
The field under validation must be greater than or equal to the given field or value.
Numeric
lessThanOrEqualTo(string $field)
The field under validation must be less than or equal to the given field.
Numeric
max(int|float $value)
The field under validation must be less than or equal to a maximum value.
Numeric
multipleOf(int|float $value)
The field under validation must be a multiple of the given value.