40 lines
1.2 KiB
PHP
40 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class ReceiveWebmailMessageRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'from_email' => ['required', 'email:rfc,dns'],
|
|
'from_name' => ['nullable', 'string', 'max:255'],
|
|
'to' => ['required', 'array', 'min:1'],
|
|
'to.*' => ['required', 'email:rfc,dns'],
|
|
'cc' => ['nullable', 'array'],
|
|
'cc.*' => ['email:rfc,dns'],
|
|
'bcc' => ['nullable', 'array'],
|
|
'bcc.*' => ['email:rfc,dns'],
|
|
'subject' => ['nullable', 'string', 'max:255'],
|
|
'body' => ['nullable', 'string'],
|
|
'folder' => ['nullable', 'string', 'max:30'],
|
|
'status' => ['nullable', 'string', 'max:30'],
|
|
'received_at' => ['nullable', 'date'],
|
|
'attachments' => ['nullable', 'array'],
|
|
'metadata' => ['nullable', 'array'],
|
|
'message_uid' => ['nullable', 'string', 'max:255'],
|
|
];
|
|
}
|
|
} |