32 lines
790 B
PHP
32 lines
790 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdatePengumumanRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'judul' => 'required|string|max:80',
|
|
'isi' => 'required|string|max:500',
|
|
'foto' => 'nullable|image|mimes:jpeg,png,jpg|max:2048',
|
|
'lampiran' => 'nullable|file|mimes:pdf,doc,docx,xls,xlsx|max:5120',
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'judul.required' => 'Judul pengumuman wajib diisi.',
|
|
'judul.max' => 'Judul maksimal 80 karakter.',
|
|
'isi.required' => 'Isi pengumuman wajib diisi.',
|
|
];
|
|
}
|
|
} |