shapecode/cron-bundle
Laravel-friendly cron scheduler bundle that lets you define, manage, and run scheduled jobs from your app. Provides an easy API for registering tasks, configuring frequency and conditions, and executing commands reliably with clear organization and control.
Artisan::schedule()). Complements Laravel’s built-in task scheduling but adds a more structured, bundle-based approach.config/cron.php), improving maintainability for large applications.php artisan queue:work), enabling asynchronous execution for long-running tasks.ScheduleTestCase).@hourly, @daily) align with business requirements? Are there tasks that shouldn’t be abstracted (e.g., system-critical cron jobs)?retryAfter()) be implemented?* * * * *) be managed across environments (dev/staging/prod)? Will the bundle’s YAML/JSON config suffice, or is a secrets manager needed?schedule:run command.crontab -e with bundle configurations, reducing environment drift.crontab entries with bundle configurations (e.g., config/cron.php).CronJob facade to wrap existing Artisan commands.retryAfter().* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1).composer require shapecode/cron-bundle.php artisan vendor:publish --tag=cron-bundle-config.config/cron.php with task definitions.ScheduleTestCase or manual time manipulation.crontab to point to artisan schedule:run.config/cron.php, reducing scattered cron entries across servers.storage/logs/laravel.log) or database logs (if enabled).schedule:run command’s execution (e.g., via ps aux | grep artisan).schedule:run (e.g., via a lock file or distributed task queue like RabbitMQ).schedule:run.schedule:run execution time; long runs may indicate misconfigured tasks.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Cron daemon misconfiguration | Tasks never run | Use tools like cronitor or deadmanssnitch to monitor cron execution. |
schedule:run command fails |
All tasks fail | Wrap in a health check; use a process manager (e.g., Supervisor) for restarts. |
| Database connection issues | Logged tasks fail silently | Implement retry logic with exponential backoff. |
| Task logic errors | Partial failures | Use Laravel’s retryAfter() or queue retries. |
| Server outages | Missed task executions | For critical tasks, use external monitoring (e.g., AWS CloudWatch Events). |
CronJob facade, task registration syntax, and schedule:run workflow.schedule:run, misconfiguring task frequencies).How can I help you explore Laravel packages today?