Skip to content

Commit 29108db

Browse files
Update api/app/Http/Requests/UserFormRequest.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent dab8b22 commit 29108db

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

api/app/Http/Requests/UserFormRequest.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ protected function prepareForValidation()
1919
$data = $this->all();
2020

2121
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
22+
$data['properties'] = array_map(function ($property) {
23+
if (isset($property['help']) && is_string($property['help']) && strip_tags($property['help']) === '') {
2424
$property['help'] = null;
2525
}
26-
}
26+
return $property;
27+
}, $data['properties']);
2728
}
2829

2930
$this->merge($data);

0 commit comments

Comments
 (0)