57 lines
1.2 KiB
PHP
57 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Modules\Sirsoft\Board\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
/**
|
|
* 댓글 블라인드 처리 요청 폼 검증
|
|
*/
|
|
class BlindCommentRequest extends FormRequest
|
|
{
|
|
/**
|
|
* 사용자가 이 요청을 수행할 권한이 있는지 확인
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* 요청에 적용할 검증 규칙
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'reason' => ['nullable', 'string'],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* 검증 오류 메시지 커스터마이징
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'reason.min' => __('sirsoft-board::validation.blind.reason.min'),
|
|
'reason.max' => __('sirsoft-board::validation.blind.reason.max'),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* 검증할 필드의 이름을 커스터마이징
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'reason' => __('sirsoft-board::attributes.blind.reason'),
|
|
];
|
|
}
|
|
}
|