spatie / laravel-pdf

Create PDF files in Laravel apps
https://spatie.be/docs/laravel-pdf
MIT License
729 stars 56 forks source link

Fix setting the name via download() #139

Closed stevethomas closed 6 months ago

stevethomas commented 6 months ago

We had a test like this that was failing after updating to 1.5:

 Pdf::assertRespondedWithPdf(fn (PdfBuilder $pdf) => $pdf->downloadName === $invoice->filename));

The reason being that $pdf->downloadName is still an empty string, despite calling ->download($invoice->filename) in the controller.

I believe this fixes #138.

Oddly enough some tests including the pdf function download accepts a name parameter and sets downloadName failed on the old implementation, so not sure how that one got through 🤷‍♂️

freekmurze commented 6 months ago

Thanks!