← Back to Course

Setting Up Task Scheduling with schedule:run

Instead of configuring a separate cron entry for every recurring task, Laravel centralizes all scheduled work in one place and needs only a single cron entry to drive everything.

The One Cron Entry You Need

* * * * * cd /path-to-project && php artisan schedule:run >> /dev/null 2>&1

This runs every minute and lets Laravel decide internally which scheduled tasks are actually due to run at that moment.

Defining Scheduled Tasks

Scheduled tasks are defined in the schedule method of app/Console/Kernel.php (or in routes/console.php in newer Laravel versions).

protected function schedule(Schedule $schedule)
{
    $schedule->command('reports:generate')->daily();
}

Why This Design Is Useful

Understanding this single entry point makes it easier to see exactly how Laravel's scheduler relates to the underlying system crontab, which is covered next.

Ready to master Laravel Training Course?

Join Uncodemy's hands-on Laravel program and build real, production-ready applications.

Explore Course