Update Request validation, so that it also knows about required schema attributes

This commit is contained in:
2025-03-01 19:30:21 +11:00
parent 0684424328
commit f08fdb1bcd
3 changed files with 38 additions and 5 deletions

View File

@@ -26,9 +26,9 @@ class EntryRequest extends FormRequest
return config('server')
->schema('attributetypes')
->intersectByKeys($this->request)
->transform(function($item) { return $item->validation; })
->map(fn($item)=>$item->validation(request()->get('objectclass')))
->filter()
->flatMap(function($item) { return $item; })
->flatMap(fn($item)=>$item)
->toArray();
}
}