Laravel计划有效,但命令不起作用

时间:2016-02-28 10:22:49

标签: laravel command schedule

随着laravel计划我有问题。计划运行但命令不起作用。这里是example.I我每分钟都从日程安排发送邮件,并且还希望每分钟运行一次命令来测试它。命令不起作用。我没有收到来自命令的电子邮件(文本“命令已执行”)。我做错了什么? 请帮忙。

Kernel.php

class Kernel extends ConsoleKernel {

    protected $commands = [
        'App\Console\Commands\myCustomCommand'
    ];

    protected function schedule(Schedule $schedule) {

        //this works
        sendMailFunction('someone@gmail.com', 'test mail', 'schedule executed'); 

        //this is not working
        $schedule->command('command:myCustomCommand')->cron('* * * * *')
    }

}

命令

class myCustomCommand extends Command {


    protected $name = 'command:myCustomCommand';


    protected $description = 'some description';


    public function handle() {
        sendMailFunction('someone@gmail.com', 'test mail', 'command executed');
    }

}

0 个答案:

没有答案