我在控制台/内核
中添加了以下代码:
protected function schedule(Schedule $schedule)
{
$schedule->command('queue:work')
->everyMinute()
->appendOutputTo($filePath);
}
然后我在命令提示符中运行了以下Artisan命令来运行预定任务,但我收到以下错误。
php artisan schedule:run
错误:
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined method Illuminate\Console\Scheduling\Event::appendOutputTo()
当我使用
->sendOutputTo($filename)
时,它可以正常工作,当然它不会追加而是覆盖文件。谢谢,
K