I am new in laravel and i tried to set task scheduler using cpanel cronjob. But cronjob not working.
php /home/webservername/public_html/demo/projectname/artisan schedule:run 1>> /dev/null 2>&1
My kernel code :
protected $commands = [
Commands\HourlyUpdate::class,
];
protected function schedule(Schedule $schedule)
{
$schedule->command('hour:update')
->everyMinute();
$schedule->call(function () {
DB::table('test')->insert(
['title' => 'test', 'datetime' => '2018-07-10 14:38:00']
);
})->everyMinute();
}
When i run project in my localhost, try using command prompt its working.
php artisan schedule:run