joaopaulolndev / filament-pdf-viewer

FilamentPHP package to show pdf documents with records saved in the database or show documents without a database in the form of your resource.
MIT License
63 stars 11 forks source link

[Bug]: Upload multiple PDFs and only shows one of them in the viewer #10

Open DevShaded opened 1 month ago

DevShaded commented 1 month ago

What happened?

I currently have a FileUpload form where a user can upload a PDF file. When I upload the first PDF file, the PDF shows in the preview. When I upload a second PDF and then save, I don't see the second PDF in the view.

How to reproduce the bug

This is the code I added:

FileUpload::make('document_management')
    ->panelLayout('grid')
    ->previewable()
    ->multiple(),

PdfViewerField::make('document_management')
    ->label('View the PDF')
    ->minHeight('40svh'),

Here is an example:

https://github.com/user-attachments/assets/6c169bcb-3a6f-4926-9a6a-75ae571df3ed

Package Version

v1.0.5

PHP Version

v8.3.11

Laravel Version

v11.23.5

Which operating systems does with happen with?

macOS

Notes

No response

joaopaulolndev commented 1 month ago

This is not a bug, the plugin is now prepared just for a single PDF per field

DevShaded commented 1 month ago

Can I make a pull request to support multiple PDFs?

joaopaulolndev commented 1 month ago

@DevShaded yeah, go ahead. Just pay attention to work default as now for not break other projects.

DevShaded commented 1 month ago

Got it!