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
24 lines
531 B
PHP
24 lines
531 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\SchoolYears;
|
|
|
|
use App\Services\Auth\PermissionCheckService;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class ArchiveSchoolYearRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
$userId = (int) ($this->user()?->id ?? 0);
|
|
|
|
return app(PermissionCheckService::class)->hasPermission($userId, 'school_year.archive');
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'reason' => ['nullable', 'string', 'max:1000'],
|
|
];
|
|
}
|
|
}
|