Task Scheduling can be a very powerful resource for your application but it needs use CRON jobs to work. Laravel’s command scheduler allows you to define your command schedule within Laravel itself, saving a lot of grief on the server! However it does require you to set up one CRON job on the server itself to trigger all the ones you write in your Laravel app.
The CRON entry you need is this:
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
So you need to find a way of adding this to your Cron Jobs on your hosting server.
So, to set it up, first you need to go to the application you want it to run on. The easiest way of doing this is to go to Applications on the top menu. The choose the application you want.
Then in the Application Management menu on the right, choose CRON Job Management, then click on the Advanced tab.
The only really tricky part is getting the path right. So below is the path that you would use if you are on a Cloudways server, the bit that will change for you is the name of the application.
* * * * * cd /home/master/applications/changethisbit/public_html/ && php artisan schedule:run >> /dev/null 2>&1
The name you need to add it is the random list of letters that signifies your app. Cloudways use this for your database name too.
Make sure you save it and that’s it, your CRON job is now set up and you can add whatever you like in your Laravel app without having to come back here to make any changes.