first commit

This commit is contained in:
Saufi
2026-06-24 20:32:14 +08:00
commit 10fb30ad69
201 changed files with 21356 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class ReportingCycleRequest extends FormRequest
{
public function authorize(): bool
{
return $this->user()->can('kitaran.urus');
}
public function rules(): array
{
$cycleId = $this->route('reporting_cycle')?->id;
return [
'renewal_year' => [
'required', 'integer', 'min:2000', 'max:2100',
Rule::unique('reporting_cycles', 'renewal_year')->ignore($cycleId),
],
'cut_off_date' => ['nullable', 'date'],
'licence_period_year' => ['required', 'integer', 'min:1', 'max:10'],
'checklist_template_id' => ['nullable', 'exists:checklist_templates,id'],
'status' => ['required', 'in:aktif,tutup'],
'catatan' => ['nullable', 'string', 'max:1000'],
];
}
public function attributes(): array
{
return [
'renewal_year' => 'tahun pembaharuan',
'cut_off_date' => 'tarikh tutup',
'licence_period_year' => 'tempoh lesen (tahun)',
];
}
}