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.
23 lines
347 B
23 lines
347 B
2 months ago
|
<?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;
|
||
|
}
|
||
|
]
|
||
|
];
|