laravel-task-scheduling

star 136

Schedule tasks with safety; use withoutOverlapping, onOneServer, and visibility settings for reliable cron execution

jpcaparas By jpcaparas schedule Updated 11/4/2025

name: laravel:task-scheduling description: Schedule tasks with safety; use withoutOverlapping, onOneServer, and visibility settings for reliable cron execution

Task Scheduling

Run scheduled tasks predictably across environments.

Commands

// app/Console/Kernel.php
protected function schedule(Schedule $schedule): void
{
    $schedule->command('reports:daily')
        ->dailyAt('01:00')
        ->withoutOverlapping()
        ->onOneServer()
        ->runInBackground()
        ->evenInMaintenanceMode();
}

# Run the scheduler from cron
* * * * * cd /var/www/app && php artisan schedule:run >> /dev/null 2>&1

Patterns

  • Guard long-running commands with withoutOverlapping()
  • Use onOneServer() when running on multiple nodes
  • Emit logs/metrics for visibility; consider notifications on failure
  • Feature-flag risky jobs via config/env
Install via CLI
npx skills add https://github.com/jpcaparas/superpowers-laravel --skill laravel-task-scheduling
Repository Details
star Stars 136
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator