Files
Gnuboard7/app/Http/Requests/Settings/UpdateSettingRequest.php
T
2026-04-01 10:30:52 +09:00

47 lines
1.2 KiB
PHP

<?php
namespace App\Http\Requests\Settings;
use App\Extension\HookManager;
use Illuminate\Foundation\Http\FormRequest;
class UpdateSettingRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
$rules = [
'value' => 'required|string|max:1000',
];
// 모듈/플러그인이 validation rules를 동적으로 추가할 수 있도록 훅 제공
return HookManager::applyFilters('core.settings.update_validation_rules', $rules, $this);
}
/**
* Get custom messages for validator errors.
*
* @return array<string, string>
*/
public function messages(): array
{
return [
'value.required' => __('validation.setting.value.required'),
'value.string' => __('validation.setting.value.string'),
'value.max' => __('validation.setting.value.max'),
];
}
}