这是我的核心:
protected $commands = [
Commands\AdvertiseTasks::class,
];
protected function schedule(Schedule $schedule)
{
$schedule->command('advertise:delete')->everyMinute();
}
这是我的命令句柄
public function handle()
{
Advertise::where('expired', '<=', Carbon::now()->createFromTime(23, 59, 59))->delete();
$this->info('All Expired Advertise Are Deleted Successfully!' . Carbon::now());
Log::info('All Expired Advertise Are Deleted Successfully!');
}
我在我的项目上运行此命令:
cd /wamp/www/project
php artisan schedule:run
当我按下输入时我查看我的日志就可以了。日志已更改,但在几分钟后,日志不会更改,并且Crone未自动启动。我该怎么办?
答案 0 :(得分:0)