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

Feature/events dispatching available on Monitor model #150

Open alessandrofuda opened 1 month ago

alessandrofuda commented 1 month ago

Hi, for my need I had to intercept some user action from the UI (relative to queue_monitor table, Monitor model). For example, when a user delete an item from UI, I have to implement some action in my application.

So I propose to manage Events fired by the Monitor model (on deleting and creating records).

So, developers can makes their Listeners, on application side, "hooking" to package's Events.

In short: make available 4 main Events we can use in our listeners in our application.

Let me know if might be useful, thanks

(in the pr , restore .gitignore and composer.json)

romanzipp commented 1 month ago

Hey! Thanks for your contribution. The PR itself looks good but I'm currently debating if a custom Monitor class which can be overridden by the consuming application would be a good idea. Nonetheless, it looks like you have deleted the composer.json, I assume that was a mistake?

alessandrofuda commented 1 month ago

it looks like you have deleted the composer.json, I assume that was a mistake?

Yes, sure is my fault :)

alessandrofuda commented 1 month ago

it looks like you have deleted the composer.json, I assume that was a mistake?

Yes, sure is my fault :)

Restored composer.json and .gitignore

alessandrofuda commented 1 month ago

I'm currently debating if a custom Monitor class which can be overridden by the consuming application would be a good idea.

Yes, for the moment I use my custom Monitor class via model value into config/queue-monitor.php. My custom model extends package Monitor model.