Dimensions
class Dimensions implements Stringable
Traits
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.
Create a new dimensions rule instance.
Set the "width" constraint.
Set the "height" constraint.
Set the "min width" constraint.
Set the "min height" constraint.
Set the "max width" constraint.
Set the "max height" constraint.
Set the "ratio" constraint.
Set the minimum aspect ratio.
Set the maximum aspect ratio.
Set the aspect ratio range.
Convert the rule to a validation string.
Details
in
Conditionable at line 23
mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
in
Conditionable at line 56
mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
at line 19
__construct(array $constraints = [])
Create a new dimensions rule instance.
at line 27
Dimensions
width(int|string $value)
Set the "width" constraint.
at line 37
Dimensions
height(int|string $value)
Set the "height" constraint.
at line 47
Dimensions
minWidth(int|string $value)
Set the "min width" constraint.
at line 57
Dimensions
minHeight(int|string $value)
Set the "min height" constraint.
at line 67
Dimensions
maxWidth(int|string $value)
Set the "max width" constraint.
at line 77
Dimensions
maxHeight(int|string $value)
Set the "max height" constraint.
at line 87
Dimensions
ratio(float|string $value)
Set the "ratio" constraint.
at line 97
Dimensions
minRatio(float|string $value)
Set the minimum aspect ratio.
at line 107
Dimensions
maxRatio(float|string $value)
Set the maximum aspect ratio.
at line 117
Dimensions
ratioBetween(float|string $min, float|string $max)
Set the aspect ratio range.
at line 128
string
__toString()
Convert the rule to a validation string.