diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 3928ffed..671d3b3b 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -84,6 +84,7 @@ public function render($request, Throwable $exception) return response()->json([ 'success' => false, 'message' => '입력값 검증 실패', + 'errors' => $exception->errors(), 'error' => [ 'code' => 422, 'details' => $exception->errors(), diff --git a/app/Http/Requests/ItemMaster/IndependentFieldStoreRequest.php b/app/Http/Requests/ItemMaster/IndependentFieldStoreRequest.php index 52acba9f..3350d6b2 100644 --- a/app/Http/Requests/ItemMaster/IndependentFieldStoreRequest.php +++ b/app/Http/Requests/ItemMaster/IndependentFieldStoreRequest.php @@ -16,7 +16,7 @@ public function rules(): array return [ 'group_id' => 'nullable|integer', 'field_name' => 'required|string|max:255', - 'field_key' => 'nullable|string|max:80|regex:/^[a-zA-Z][a-zA-Z0-9_]*$/', + 'field_key' => 'nullable|string|max:80|regex:/^[a-zA-Z0-9][a-zA-Z0-9_]*$/', 'field_type' => 'required|in:textbox,number,dropdown,checkbox,date,textarea', 'is_required' => 'nullable|boolean', 'default_value' => 'nullable|string', diff --git a/app/Http/Requests/ItemMaster/ItemFieldStoreRequest.php b/app/Http/Requests/ItemMaster/ItemFieldStoreRequest.php index 9092538e..ecaaadd5 100644 --- a/app/Http/Requests/ItemMaster/ItemFieldStoreRequest.php +++ b/app/Http/Requests/ItemMaster/ItemFieldStoreRequest.php @@ -16,7 +16,7 @@ public function rules(): array return [ 'group_id' => 'nullable|integer|min:1', // 계층번호 'field_name' => 'required|string|max:255', - 'field_key' => 'nullable|string|max:80|regex:/^[a-zA-Z][a-zA-Z0-9_]*$/', + 'field_key' => 'nullable|string|max:80|regex:/^[a-zA-Z0-9][a-zA-Z0-9_]*$/', 'field_type' => 'required|in:textbox,number,dropdown,checkbox,date,textarea', 'is_required' => 'nullable|boolean', 'default_value' => 'nullable|string', diff --git a/app/Http/Requests/ItemMaster/ItemFieldUpdateRequest.php b/app/Http/Requests/ItemMaster/ItemFieldUpdateRequest.php index cd919314..51c5236f 100644 --- a/app/Http/Requests/ItemMaster/ItemFieldUpdateRequest.php +++ b/app/Http/Requests/ItemMaster/ItemFieldUpdateRequest.php @@ -15,7 +15,7 @@ public function rules(): array { return [ 'field_name' => 'sometimes|string|max:255', - 'field_key' => 'nullable|string|max:80|regex:/^[a-zA-Z][a-zA-Z0-9_]*$/', + 'field_key' => 'nullable|string|max:80|regex:/^[a-zA-Z0-9][a-zA-Z0-9_]*$/', 'field_type' => 'sometimes|in:textbox,number,dropdown,checkbox,date,textarea', 'is_required' => 'nullable|boolean', 'default_value' => 'nullable|string',