Files
onboard/app/Infrastructure/Http/Requests/CreateDutyReportRequest.php
2026-07-31 17:19:03 +09:00

28 lines
812 B
PHP

<?php
namespace App\Infrastructure\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class CreateDutyReportRequest extends FormRequest
{
public function authorize(): bool
{
return auth()->check();
}
public function rules(): array
{
return [
'period_start' => ['required', 'date'],
'period_end' => ['required', 'date', 'after_or_equal:period_start'],
'period_type' => ['nullable', 'string', 'in:day,week,month'],
'status_id' => ['nullable', 'integer', 'in:1,2,3'],
'observables' => ['nullable', 'array'],
'observables.*.id' => ['required', 'integer'],
'unwanted_events' => ['nullable', 'array'],
'unwanted_events.*.title' => ['required', 'string'],
];
}
}