feat(attachments): enhance AttachmentService to support base64 file uploads and refactor file handling logic

This commit is contained in:
2026-06-25 16:09:46 -03:00
parent 17799122e2
commit 2ce21799c7
3 changed files with 149 additions and 29 deletions

View File

@@ -20,7 +20,7 @@ class S3TestController extends Controller
public function store(StoreS3TestFileRequest $request): JsonResponse
{
$attachment = $this->attachmentService->store(
$request->file('file'),
$request->file('file') ?? (string) $request->validated('file_base64'),
$request->validated('path'),
);

View File

@@ -17,7 +17,8 @@ class StoreS3TestFileRequest extends FormRequest
public function rules(): array
{
return [
'file' => ['required', 'file', 'max:10240'],
'file' => ['nullable', 'file', 'max:10240', 'required_without:file_base64'],
'file_base64' => ['nullable', 'string', 'required_without:file'],
'path' => ['required', 'string', 'max:2048'],
'expires_in_minutes' => ['nullable', 'integer', 'min:1', 'max:1440'],
];