Dimensions
class Dimensions implements Stringable (View source)
Traits
Properties
protected array | $constraints | The constraints for the dimensions rule. |
Methods
$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.
from
Conditionable
$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.
from
Conditionable
__construct(array $constraints = [])
Create a new dimensions rule instance.
$this
width(int $value)
Set the "width" constraint.
$this
height(int $value)
Set the "height" constraint.
$this
minWidth(int $value)
Set the "min width" constraint.
$this
minHeight(int $value)
Set the "min height" constraint.
$this
maxWidth(int $value)
Set the "max width" constraint.
$this
maxHeight(int $value)
Set the "max height" constraint.
$this
ratio(float $value)
Set the "ratio" constraint.
$this
minRatio(float $value)
Set the minimum aspect ratio.
$this
maxRatio(float $value)
Set the maximum aspect ratio.
$this
ratioBetween(float $min, float $max)
Set the aspect ratio range.
string
__toString()
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.