From the course: Advanced Laravel
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Schedule tasks - Laravel Tutorial
From the course: Advanced Laravel
Schedule tasks
- [Instructor] Usually there will be some tasks in your project that needs to be automated and performed regularly without manual intervention like sending a weekly report to our members of how many classes they attended and approximately how many calories they burned or a friendly reminder at the end of each day to those members who haven't booked a class for the next day. In certain apps, you may want to delete trash records occasionally and so on. In the past you may have used Cron Jobs for every such task that needs to be performed regularly, but it becomes a pain to manage tasks that way because you have to log into your server and schedule a task Using Cron Jobs. Thanks to Laravel's scheduler, you can define your command schedule within your application itself. Let me show you. Go to Kernel.php within App\Console and you can see an example right here. If you uncomment this, the command inspire can be scheduled…