Files
alrahma_sunday_school_api/app/Http/Requests/SchoolYears/ReopenSchoolYearRequest.php
T
root 39228168c8
API CI/CD / Validate (composer + pint) (push) Successful in 3m14s
API CI/CD / Test (PHPUnit) (push) Failing after 3m28s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Security audit (push) Failing after 56s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
add school year and security fix
2026-07-06 00:55:01 -04:00

24 lines
529 B
PHP

<?php
namespace App\Http\Requests\SchoolYears;
use App\Services\Auth\PermissionCheckService;
use Illuminate\Foundation\Http\FormRequest;
class ReopenSchoolYearRequest extends FormRequest
{
public function authorize(): bool
{
$userId = (int) ($this->user()?->id ?? 0);
return app(PermissionCheckService::class)->hasPermission($userId, 'school_year.reopen');
}
public function rules(): array
{
return [
'reason' => ['nullable', 'string', 'max:1000'],
];
}
}