I have a schedule function in Laravel. It work good on localhost but it doesn't work on host server.
Hi,
I want send SMS for some customers daily. I wrote schedule in Laravel. It works good in localhost using :
php artisan schedule:run
my schedule function :
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*/
protected $commands = [
Commands\MyCommands::class
];
protected function schedule(Schedule $schedule): void
{
$schedule->call(function () {
$hc = new SendSMSController();
$hc->sendDelaySMS();
})->everyMinute();
}
and my CPanel cronjob is:
* 11 * * * /usr/local/bin/php /home/boschapp/domains/warranty.boschapp.ir/public_html/laravel/artisan schedule:run >> /dev/null 2>&1
But it doesn't work on host server.