From 7412f5315bbb2fa5ea4a05743d615e56b397a96e Mon Sep 17 00:00:00 2001 From: Roman Zipp Date: Thu, 5 Dec 2024 15:46:27 +0100 Subject: [PATCH] Disable route registration if ui disabled Resolves #162 --- src/Providers/QueueMonitorProvider.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Providers/QueueMonitorProvider.php b/src/Providers/QueueMonitorProvider.php index d31aba0..5a7446a 100644 --- a/src/Providers/QueueMonitorProvider.php +++ b/src/Providers/QueueMonitorProvider.php @@ -53,9 +53,11 @@ public function boot(): void 'queue-monitor' ); - Route::group($this->buildRouteGroupConfig(), function () { - $this->loadRoutesFrom(__DIR__ . '/../../routes/queue-monitor.php'); - }); + if (config('queue-monitor.ui.enabled')) { + Route::group($this->buildRouteGroupConfig(), function () { + $this->loadRoutesFrom(__DIR__ . '/../../routes/queue-monitor.php'); + }); + } // listen to JobQueued event if (config('queue-monitor.monitor_queued_jobs', true)) {