Home > OS >  Cron jobs with laravel using hostinger
Cron jobs with laravel using hostinger

Time:12-22

I had problem setting up cron jobs to send automated emails under hostinger server. I tested out the automated email function through smtp under local environment using php artisan schedule:work to run the scheduled task. The email is sent out without a problem. Then i created a script in my public folder following this tutorial enter image description here

So basically what happens from this code structure.

  1. When php file called via daemons on server on regular interval of time cronsStartToWorkEmailSend.php will call.
  2. When cronsStartToWorkEmailSend.php call at that time our route cronsStartToWorkEmailSend will call.
  3. When route cronsStartToWorkEmailSend will call at that time with help of this command \Artisan::call('emailsending:cron') our cron will be triggered.
  • Related