I'm trying to get the Laravel Scheduler to run a couple of commands, however when I run php artisan schedule:run
it will only run one of the commands in the kernal.php file.
My Kernal.php file is as follows:
protected $commands = [
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('a:import')->everyMinute();
$schedule->command('b:import')->everyFiveMinutes();
}
/**
* Register the Closure based commands for the application.
*
* @return void
*/
protected function commands()
{
require base_path('routes/console.php');
}
My console.php file has the following code:
Artisan::command('a:import', function(a\ImportController $runner) {
$runner->init();
});
Artisan::command('b:import', function(b\ImportController
$runner) {
$runner->beginImport();
});
and when I run php artisan schedule:run I get the following result:
D:\development\v2> php artisan schedule:run
´╗┐Running scheduled command: "C:\Program Files\PHP\v7.0\php.exe" "artisan" a:import > "NUL" 2>&1
Any help in identifying what I've missed or anything else I need to do would be appreciated.