- return response()->json([
- 'status' => 'success',
- 'message' => 'Import deleted successfully',
- ]);
+ return response('', 204);
+ }
+
+ protected function rules(): array
+ {
+ return [
+ 'create' => [
+ 'file' => ['required', ...AttachmentService::getFileValidationRules()],
+ ],
+ 'run' => [
+ 'parent_type' => ['string', 'in:book,chapter'],
+ 'parent_id' => ['int'],
+ ],
+ ];
+ }
+
+ protected function formatErrors(array $errors): string
+ {
+ $parts = [];
+ foreach ($errors as $key => $error) {
+ if (is_string($key)) {
+ $parts[] = "[{$key}] {$error}";
+ } else {
+ $parts[] = $error;
+ }
+ }
+ return implode("\n", $parts);