- InspectionController 생성 (CRUD + stats + complete) - InspectionService 생성 (비즈니스 로직) - FormRequest 생성 (Store/Update/Complete) - 라우트 등록 (7개 엔드포인트) - i18n 메시지 추가 (message.php, error.php) 기존 inspections 테이블 및 Inspection 모델 활용 Co-Authored-By: Claude <noreply@anthropic.com>
31 lines
708 B
PHP
31 lines
708 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Inspection;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class InspectionCompleteRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'result' => ['required', Rule::in(['pass', 'fail'])],
|
|
'opinion' => ['nullable', 'string', 'max:2000'],
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'result.required' => __('validation.required', ['attribute' => '검사결과']),
|
|
'result.in' => __('validation.in', ['attribute' => '검사결과']),
|
|
];
|
|
}
|
|
}
|