With laravel schedule I have problem. schedule runs but command not working. here is example.I send mail from schedule on every minute and also want to run command on every minute to test it. command not working. I did't get email from command(with text "command executed").What I am doing wrong? Please help.
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('* * * * *')
}
}
Command
class myCustomCommand extends Command {
protected $name = 'command:myCustomCommand';
protected $description = 'some description';
public function handle() {
sendMailFunction('someone@gmail.com', 'test mail', 'command executed');
}
}