[Bug]: optional parameter in `download()` method is required
vintagesucks opened this issue · 2 comments
What happened?
The docs suggest combining name()
with download()
like this:
laravel-pdf/docs/basic-usage/responding-with-pdfs.md
Lines 35 to 38 in 68f48d2
download
does not require $downloadName
to be set, but passes $downloadName
to name()
, which does:
laravel-pdf/src/PdfBuilder.php
Lines 138 to 140 in 68f48d2
laravel-pdf/src/PdfBuilder.php
Line 159 in 68f48d2
This results in the following error when calling download()
without $downloadName
:
Spatie\LaravelPdf\PdfBuilder::name(): Argument #1 ($downloadName) must be of type string, null given
How to reproduce the bug
Use download()
without an argument, as allowed by the method signature.
Package Version
1.3.0
PHP Version
8.2.16
Laravel Version
10.45.0
Which operating systems does with happen with?
macOS
Notes
No response
Same issue today, but thanks to your issue solved :D
This has been fixed in the latest release.