+
+ public static function validate(ZipValidationHelper $context, array $data): array
+ {
+ $rules = [
+ 'id' => ['nullable', 'int'],
+ 'name' => ['required', 'string', 'min:1'],
+ 'html' => ['nullable', 'string'],
+ 'markdown' => ['nullable', 'string'],
+ 'priority' => ['nullable', 'int'],
+ 'attachments' => ['array'],
+ 'images' => ['array'],
+ 'tags' => ['array'],
+ ];
+
+ $errors = $context->validateData($data, $rules);
+ $errors['attachments'] = $context->validateRelations($data['attachments'] ?? [], ZipExportAttachment::class);
+ $errors['images'] = $context->validateRelations($data['images'] ?? [], ZipExportImage::class);
+ $errors['tags'] = $context->validateRelations($data['tags'] ?? [], ZipExportTag::class);
+
+ return $errors;
+ }