Files
nyone/app/Http/Requests/StoreSupportMessageRequest.php

27 lines
584 B
PHP

<?php
namespace App\Http\Requests;
use App\Rules\SupportAttachmentFile;
use Illuminate\Foundation\Http\FormRequest;
class StoreSupportMessageRequest extends FormRequest
{
public function authorize(): bool
{
return $this->user() !== null;
}
/**
* @return array<string, array<int, mixed>>
*/
public function rules(): array
{
return [
'body' => ['required', 'string', 'max:2000'],
'attachments' => ['nullable', 'array', 'max:3'],
'attachments.*' => [new SupportAttachmentFile],
];
}
}