From f3e4dcd272d316b1480ce202da76edee03ab7e40 Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Mon, 18 Dec 2023 10:52:29 +0100 Subject: [PATCH] Fix validation select issue --- app/Http/Requests/AnswerFormRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Requests/AnswerFormRequest.php b/app/Http/Requests/AnswerFormRequest.php index 2a3039f..73e6df6 100644 --- a/app/Http/Requests/AnswerFormRequest.php +++ b/app/Http/Requests/AnswerFormRequest.php @@ -60,7 +60,7 @@ class AnswerFormRequest extends FormRequest if(isset($data[$field['id']]) && is_array($data[$field['id']])){ $data[$field['id']] = array_map(function ($val) use ($field) { $tmpop = collect($field[$field['type']]['options'])->first(function ($op) use ($val) { - return ($op['id'] === $val); + return ($op['id'] ?? $op['value'] === $val); }); return isset($tmpop['name']) ? $tmpop['name'] : ""; }, $data[$field['id']]);