On this page
Dimensions
class Dimensions (View source)
Traits
Properties
| protected array | $constraints | The constraints for the dimensions rule. |
Methods
| $this|mixed | when(mixed $value, callable $callback, callable|null $default = null) Apply the callback if the given "value" is truthy. |
from Conditionable |
| $this|mixed | unless(mixed $value, callable $callback, callable|null $default = null) Apply the callback if the given "value" is falsy. |
from Conditionable |
| void | __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. |
|
| string | __toString() Convert the rule to a validation string. |
Details
$this|mixed when(mixed $value, callable $callback, callable|null $default = null)
Apply the callback if the given "value" is truthy.
$this|mixed unless(mixed $value, callable $callback, callable|null $default = null)
Apply the callback if the given "value" is falsy.
void __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.
string __toString()
Convert the rule to a validation string.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Validation/Rules/Dimensions.html