2021-10-29 18:05:46 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
return [
|
2022-08-31 16:08:03 +02:00
|
|
|
'computed' => [
|
|
|
|
'min' => function () {
|
|
|
|
// set min to at least 1, if required
|
|
|
|
if ($this->required === true) {
|
|
|
|
return $this->min ?? 1;
|
|
|
|
}
|
2021-10-29 18:05:46 +02:00
|
|
|
|
2022-08-31 16:08:03 +02:00
|
|
|
return $this->min;
|
|
|
|
},
|
|
|
|
'required' => function () {
|
|
|
|
// set required to true if min is set
|
|
|
|
if ($this->min) {
|
|
|
|
return true;
|
|
|
|
}
|
2021-10-29 18:05:46 +02:00
|
|
|
|
2022-08-31 16:08:03 +02:00
|
|
|
return $this->required;
|
|
|
|
}
|
|
|
|
]
|
2021-10-29 18:05:46 +02:00
|
|
|
];
|