We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dab8b22 commit 29108dbCopy full SHA for 29108db
api/app/Http/Requests/UserFormRequest.php
@@ -19,11 +19,12 @@ protected function prepareForValidation()
19
$data = $this->all();
20
21
if (isset($data['properties']) && is_array($data['properties'])) {
22
- foreach ($data['properties'] as &$property) {
23
- if (isset($property['help']) && strip_tags($property['help']) === '') { // Remove help if it's empty
+ $data['properties'] = array_map(function ($property) {
+ if (isset($property['help']) && is_string($property['help']) && strip_tags($property['help']) === '') {
24
$property['help'] = null;
25
}
26
- }
+ return $property;
27
+ }, $data['properties']);
28
29
30
$this->merge($data);
0 commit comments