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
59 stars 10 forks source link

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

Open DevShaded opened 2 days ago

DevShaded commented 2 days 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 2 days ago

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

DevShaded commented 2 days ago

Can I make a pull request to support multiple PDFs?

joaopaulolndev commented 2 days ago

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

DevShaded commented 2 days ago

Got it!