25 lines
592 B
PHP
25 lines
592 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin\Manage;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class AnnouncementRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'title' => ['required', 'string', 'max:200'],
|
|
'content' => ['required', 'string'],
|
|
'department_id' => ['nullable', 'integer', Rule::exists('departments', 'id')],
|
|
'enrollment_year' => ['nullable', 'integer', 'digits:4'],
|
|
];
|
|
}
|
|
}
|