romanzipp / Laravel-Queue-Monitor

Monitoring Laravel Jobs with your Database
https://packagist.org/packages/romanzipp/laravel-queue-monitor
MIT License
660 stars 91 forks source link

Queuing a command causes an error #139

Closed bkolicoski closed 8 months ago

bkolicoski commented 8 months ago

When I try to programmatically queue a command like "queue:forget" or any other custom command that I have in the app using the "Artisan::queue" method, the call fails because the package tries to find a class with the command name and obviously such a class does not exists.

Example call: Artisan::queue("queue:forget", ['id' => $data['job']]);

Error message: class_parents(): Class queue:forget does not exist and could not be loaded {"userId":1,"exception":"[object] (ErrorException(code: 0): class_parents(): Class queue:forget does not exist and could not be loaded at C:\\laragon\\www\\eppas\\vendor\\romanzipp\\laravel-queue-monitor\\src\\Services\\ClassUses.php:48)

romanzipp commented 8 months ago

Although I can not reproduce this issue, I've pushed version 5.0.2 which first checks if the given class name exists. Does this fix your issue?

bkolicoski commented 8 months ago

@romanzipp Yes, I can confirm that the issue is resolved now.

Thanks!