Open Propaganistas opened 7 months ago
Is there some way to add a test for this?
Is there some way to add a test for this?
Not sure. I think you could borrow ideas from framework tests?
https://github.com/laravel/framework/blob/10.x/tests/Queue/QueueWorkerTest.php
Dear contributor,
because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.
Time to reopen as still unsolved.
Hi, I'm facing the same problem when generating the PDF under queue. If generate directly (sync), no issues. All defaults defined in app/Providers/AppServiceProvider.php boot().
Hi Same issue here
What happened?
I've set defaults for the PdfBuilder in a service provider's
boot()
method as described in the docs.When a PDF gets generated in a queued job:
queue:listen
queue:work
How to reproduce the bug
database
and publish the jobs tableboot()
(e.g.Pdf::default()->margin(0.4, 0.4, 0.4, 0.4, Unit::Inch)
Pdf::view('welcome')->save('somewhere')
)queue:work
Or temporarily add a dump statement in PdfBuilder's
view()
method to check themargins
property and return early. You'll notice the margins are set when runningqueue:listen
but remainnull
when runningqueue:work
.Package Version
1.4.0
PHP Version
8.3.3
Laravel Version
10.48.4