Can't you just use xDebug and stick a breakpoint in the job?
How to properly debug Jobs in Laravel 5
Hi guys,
This is bugging me for a very long time. I have another project on my hand with Jobs.
I have PHPStrom, Sublime, CentOS7, PHP 7.2 installed.
Now here is the real life example.
Before sending the DTO to Google Sheet for writing on run-time that means in handle() method I get the data for DTO from the DB, there is something nothing returning as is should so I want ot debug it.
Without going into handle() method and write each print_r() and rerun the job over and over again, and inspect what I got returned, it's just pain in both time and efficiency in my eyes.
So I wonder if somebody in the world out there has some best practice how to deal with this debugging of jobs in Laravel in conjunction with perhaps PhpStorm?!
Question is simple: How to properly debug Jobs in Laravel 5, TBH I believe answer is not that easy.
Thank you in advance for your time, Matija
You can debug jobs easily by setting the queue driver to sync. Instead of being queued they will run synchronously. Then you can use xDebug.
Please or to participate in this conversation.