我已经设置了一个命令,生成一个带有一些统计信息的PDF
,它发送pdf
作为电子邮件中的附件。当我在控制台中手动运行t时,该命令很好用。流明任务调度everyMinute不工作?
php artisan send:report
现在我试图设置该命令是在每月的最后一天执行的。为了测试,我已经将调度程序设置为everyMinute
,但是当我运行php artisan schedule:run
时,只有一次运行该命令而不是每分钟发送一次该电子邮件。
我在这里做错了什么?
管腔
<?php
namespace App\Console;
use App\Console\Commands\SendReport;
use Illuminate\Console\Scheduling\Schedule;
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
SendReport::class,
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('report:send')->everyMinute();
}
}
我Kernel.php文件我缺少的东西?
任何帮助,非常感谢!
非常感谢提前!
你可以添加命令行为代码吗? –
@Sagar该命令的工作原理,我测试它通过运行它manualy php artisan报告:发送。但我认为问题是我没有设置一个cronjob来运行日程表 –
@FrankLucas是的,这是问题所在。 – sisve