You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
347 B
22 lines
347 B
<?php
|
|
|
|
return [
|
|
'computed' => [
|
|
'min' => function () {
|
|
// set min to at least 1, if required
|
|
if ($this->required === true) {
|
|
return $this->min ?? 1;
|
|
}
|
|
|
|
return $this->min;
|
|
},
|
|
'required' => function () {
|
|
// set required to true if min is set
|
|
if ($this->min) {
|
|
return true;
|
|
}
|
|
|
|
return $this->required;
|
|
}
|
|
]
|
|
];
|
|
|