Files
sam-manage/app/Http/Requests/Roadmap/UpdatePlanRequest.php
김보곤 f7a9575655 feat: [roadmap] 중장기 계획 메뉴 및 전용 페이지 개발
- 모델: AdminRoadmapPlan, AdminRoadmapMilestone
- 서비스: RoadmapPlanService, RoadmapMilestoneService
- FormRequest: Store/Update Plan/Milestone 4개
- 컨트롤러: Blade(RoadmapController), API(Plan/Milestone) 3개
- 라우트: web.php, api.php에 roadmap 라우트 추가
- Blade 뷰: 대시보드, 목록, 생성, 수정, 상세, 파셜 테이블 6개
- HTMX 기반 필터링/페이지네이션, 마일스톤 인라인 추가/토글
2026-03-02 15:50:43 +09:00

61 lines
2.1 KiB
PHP

<?php
namespace App\Http\Requests\Roadmap;
use App\Models\Admin\AdminRoadmapPlan;
use Illuminate\Foundation\Http\FormRequest;
class UpdatePlanRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'title' => 'required|string|max:200',
'description' => 'nullable|string|max:2000',
'content' => 'nullable|string',
'category' => 'nullable|in:'.implode(',', array_keys(AdminRoadmapPlan::getCategories())),
'status' => 'nullable|in:'.implode(',', array_keys(AdminRoadmapPlan::getStatuses())),
'priority' => 'nullable|in:'.implode(',', array_keys(AdminRoadmapPlan::getPriorities())),
'phase' => 'nullable|in:'.implode(',', array_keys(AdminRoadmapPlan::getPhases())),
'start_date' => 'nullable|date',
'end_date' => 'nullable|date|after_or_equal:start_date',
'progress' => 'nullable|integer|min:0|max:100',
'color' => 'nullable|string|max:7',
'sort_order' => 'nullable|integer',
];
}
public function attributes(): array
{
return [
'title' => '계획 제목',
'description' => '설명',
'content' => '상세 내용',
'category' => '카테고리',
'status' => '상태',
'priority' => '우선순위',
'phase' => 'Phase',
'start_date' => '시작일',
'end_date' => '종료일',
'progress' => '진행률',
'color' => '색상',
];
}
public function messages(): array
{
return [
'title.required' => '계획 제목은 필수입니다.',
'title.max' => '계획 제목은 최대 200자까지 입력 가능합니다.',
'end_date.after_or_equal' => '종료일은 시작일 이후여야 합니다.',
'progress.min' => '진행률은 0 이상이어야 합니다.',
'progress.max' => '진행률은 100 이하여야 합니다.',
];
}
}