- FormRequest 패턴 적용 (CategoryFieldStoreRequest, CategoryFieldUpdateRequest)
- Service에서 Validator::make() 제거
- Controller 메시지 i18n 키로 변경 (__('message.category_field.*'))
- is_required 타입을 'Y'/'N' → boolean으로 통일
- Swagger 스키마 is_required boolean 타입으로 업데이트
- Model scopeRequired() boolean 조건으로 변경
28 lines
737 B
PHP
28 lines
737 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\CategoryField;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class CategoryFieldUpdateRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'field_key' => 'sometimes|string|max:30|alpha_dash',
|
|
'field_name' => 'sometimes|string|max:100',
|
|
'field_type' => 'sometimes|string|max:20',
|
|
'is_required' => 'sometimes|boolean',
|
|
'sort_order' => 'sometimes|integer|min:0',
|
|
'default_value' => 'nullable|string|max:100',
|
|
'options' => 'nullable|json',
|
|
'description' => 'nullable|string|max:255',
|
|
];
|
|
}
|
|
}
|