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
So basically what happens from this code structure.
- When php file called via daemons on server on regular interval of time cronsStartToWorkEmailSend.php will call.
- When cronsStartToWorkEmailSend.php call at that time our route cronsStartToWorkEmailSend will call.
- When route cronsStartToWorkEmailSend will call at that time with help of this command \Artisan::call('emailsending:cron') our cron will be triggered.