add school year model

This commit is contained in:
root
2026-06-07 00:52:01 -04:00
parent a192ed433d
commit 6866aedf42
36 changed files with 4771 additions and 88 deletions
@@ -0,0 +1,13 @@
<?php
namespace App\Http\Requests\SchoolYears;
class CloseSchoolYearRequest extends PreviewCloseSchoolYearRequest
{
public function rules(): array
{
return array_merge(parent::rules(), [
'confirmation' => ['required', 'string', 'max:80'],
]);
}
}
@@ -0,0 +1,24 @@
<?php
namespace App\Http\Requests\SchoolYears;
use Illuminate\Foundation\Http\FormRequest;
class PreviewCloseSchoolYearRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'new_school_year' => ['required', 'array'],
'new_school_year.name' => ['required', 'string', 'max:50'],
'new_school_year.start_date' => ['required', 'date'],
'new_school_year.end_date' => ['required', 'date', 'after:new_school_year.start_date'],
'transfer_unpaid_balances' => ['nullable', 'boolean'],
];
}
}
@@ -0,0 +1,22 @@
<?php
namespace App\Http\Requests\SchoolYears;
use Illuminate\Foundation\Http\FormRequest;
class SaveSchoolYearRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:50'],
'start_date' => ['required', 'date'],
'end_date' => ['required', 'date', 'after:start_date'],
];
}
}