Laravel Schedule 5.4名称,如`everyMinute()`无效

问题描述 投票:0回答:1

我正在使用Laravel 5.4

当我使用everyMinute()时,总是返回错误

In FieldFactory.php line 46:

  5 is not a valid position

[当我将其转换为cron('* * * * *')时它正在工作。


错误:

protected function schedule(Schedule $schedule)
{
    $schedule->job(new TestJob())->everyMinute();
}

工作:

protected function schedule(Schedule $schedule)
{
    $schedule->job(new TestJob())->cron('* * * * *');
}
php laravel scheduler jobs
1个回答
0
投票

我设法通过composer update解决了这个问题。我认为有些软件包依赖Laravel 5.5或更高版本。因为5.5仅要求->cron('* * * * *'),而Laravel 5.4接受->cron('* * * * * *')

© www.soinside.com 2019 - 2024. All rights reserved.