romanzipp / Laravel-Queue-Monitor

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

edit shouldBeMonitored function to take app environment in considerat… #133

Closed khattab17 closed 1 year ago

khattab17 commented 1 year ago

…ions

romanzipp commented 1 year ago

I wouldn't want to introduce a new env variable right now. You can achieve this behavior by extending the Service Provider configuration check. You would also need to override the autoloading behavior.

<?php

namespace romanzipp\QueueMonitor\Providers;

use Illuminate\Support\Facades\Config;

class ExtendedQueueMonitorProvider extends QueueMonitorProvider
{
    public function boot(): void
    {
        if (Config::get('queue-monitor.queue_monitor_enabled')) {
            parent::boot();
        }
    }
}