Heroku has the free Heroku Scheduler, but this has two disadvantages:
- it runs only every 10 minutes, every hour, or every day
- you have to add your commands in there UI
Laravel comes with an amazing Task Scheduler.
To run Laravel scheduled jobs on Heroku you have to add a new command and run that as a process.
Create the Command app/Console/Commands/SchedulerDaemon.php:
You can generate this file with:
php artisan make:command SchedulerDaemon
Add the following line to your Procfile:
Don’t forget to enable this process in the Heroku Dashboard: