Skip to content

Commit 69e7ab8

Browse files
committed
fix: tap method does not exist in < Laravel 11
1 parent dd1c2c8 commit 69e7ab8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Supervisor/SupervisorServiceProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace RalphJSmit\LaravelHorizonCron\Supervisor;
44

5-
use Illuminate\Console\Scheduling\Event;
65
use Illuminate\Console\Scheduling\Schedule;
76
use Illuminate\Support\ServiceProvider;
87

@@ -20,12 +19,13 @@ public function boot(): void
2019

2120
$this->app->booted(function () {
2221
if (config('horizon-cron-supervisor.enabled')) {
23-
$expression = config('horizon-cron-supervisor.schedule');
2422
$schedule = $this->app->make(Schedule::class);
2523

26-
$schedule->command('supervisor:check')->tap(
27-
fn (Event $event) => $event->expression = is_numeric($expression) ? "*/{$expression} * * * *" : $expression
28-
);
24+
$expression = config('horizon-cron-supervisor.schedule');
25+
26+
$schedule
27+
->command('supervisor:check')
28+
->cron(is_numeric($expression) ? "*/{$expression} * * * *" : $expression);
2929
}
3030
});
3131
}

0 commit comments

Comments
 (0)