How to get command parameters when the command is queued #51294
Answered
by
marius-mcp
melvinotieno
asked this question in
Q&A
-
Given the following command Artisan::queue('mail:send', [
'user' => $user, '--queue' => 'default'
]); I am listening to when the Queue ends through Queue::after(function (JobProcessed $event) {
$job = $event->job;
$data = $job->payload()['data'];
if ($job->resolveName() === 'mail:send') {
$command = unserialize($data['command']);
// how do i get the command parameters from here?
}
} How do I get the command parameters |
Beta Was this translation helpful? Give feedback.
Answered by
marius-mcp
May 5, 2024
Replies: 2 comments 8 replies
-
Mock a command locally with queue driver database and workers STOPPED and look in db to see the command key-value. |
Beta Was this translation helpful? Give feedback.
5 replies
-
You can use reflection to read protected properties from a class. |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
melvinotieno
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use reflection to read protected properties from a class.