diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index e6b9960..baff712 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -12,7 +12,9 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule): void { - // $schedule->command('inspire')->hourly(); + $schedule->command('run:automatically-start-activity') + ->everyMinute() // 或者使用其他频率,如 hourly(), everyFiveMinutes() 等 + ->timezone('Asia/Shanghai'); // 设置时区,根据需要选择时区 } /** @@ -24,4 +26,9 @@ class Kernel extends ConsoleKernel require base_path('routes/console.php'); } + + protected $commands = [ + Commands\AutomaticallyStartActivity::class, + ]; + }