@@ -11,6 +11,13 @@
class UserRequest extends FormRequest
{
+ protected function prepareForValidation(): void
+ {
+ if (!$this->filled('access_scope') && ($this->filled('unit_id') || $this->has('unit_ids'))) {
+ $this->merge(['access_scope' => 'unit']);
+ }
+
public function rules(): array
$rules = [