diff --git a/src/ScheduleMonitorServiceProvider.php b/src/ScheduleMonitorServiceProvider.php index 8da0cd4..29fa3a1 100644 --- a/src/ScheduleMonitorServiceProvider.php +++ b/src/ScheduleMonitorServiceProvider.php @@ -5,6 +5,7 @@ use Illuminate\Console\Events\CommandStarting; use Illuminate\Console\Scheduling\Event as SchedulerEvent; use Illuminate\Support\Facades\Event; +use Laravel\Horizon\Horizon; use OhDear\PhpSdk\OhDear; use Spatie\LaravelPackageTools\Package; use Spatie\LaravelPackageTools\PackageServiceProvider; @@ -88,6 +89,10 @@ protected function silenceOhDearJob(): self return $this; } + if (! class_exists(Horizon::class)) { + return $this; + } + $silencedJobs = config('horizon.silenced', []); if (in_array(PingOhDearJob::class, $silencedJobs)) {