|string> */ public function rules(): array { return [ 'hash' => ['required', 'string', 'max:64'], 'metadata.recipientEmail' => ['required', 'email', 'max:255'], 'metadata.recipientName' => ['nullable', 'string', 'max:255'], 'metadata.senderEmail' => ['required', 'email', 'max:255'], 'metadata.senderName' => ['nullable', 'string', 'max:255'], 'metadata.domain' => ['required', 'string', 'max:255'], 'metadata.subject' => ['nullable', 'string', 'max:500'], 'metadata.received_at' => ['required', 'date'], 'metadata.attachments' => ['nullable', 'array'], 'metadata.attachments.*.filename' => ['required_with:metadata.attachments', 'string'], 'metadata.attachments.*.mimeType' => ['required_with:metadata.attachments', 'string'], 'metadata.attachments.*.size' => ['required_with:metadata.attachments', 'integer'], 'metadata.attachmentSize' => ['nullable', 'integer', 'min:0'], 'bodyText' => ['nullable', 'string'], 'bodyHtml' => ['nullable', 'string'], ]; } /** * Custom error messages. * * @return array */ public function messages(): array { return [ 'hash.required' => 'The email hash identifier is required.', 'metadata.recipientEmail.required' => 'A recipient email address is required.', 'metadata.senderEmail.required' => 'A sender email address is required.', 'metadata.domain.required' => 'The recipient domain is required.', 'metadata.received_at.required' => 'The email received timestamp is required.', ]; } }