symfony/scheduler
Symfony Scheduler component adds cron-like task scheduling powered by Symfony Messenger. Define recurring or one-off jobs, route them through transports and workers, and run tasks reliably within Symfony apps with first-class framework integration.
schedule:run) and queue workers (queue:work) already provide equivalent functionality without external dependencies.ScheduleProviderInterface with Laravel’s Schedule class.#[AsCronTask]) for scheduling, while Laravel uses method chaining (Schedule::call()). This mismatch would require wrapper abstractions, increasing cognitive load.database, redis, beanstalkd). Forcing Symfony’s transport layer would add unnecessary complexity.PostRunEvent to Laravel’s JobProcessed or JobFailed events.php artisan schedule:run with Symfony’s scheduler:consume.| Risk Area | Severity | Mitigation |
|---|---|---|
| Architectural Divergence | Critical | Laravel’s scheduler and queues are optimized for Laravel; forcing Symfony’s layer would create technical debt. |
| Dependency Bloat | High | Adds Symfony’s Messenger, DI, and Console as hard dependencies, increasing bundle size and version conflict risks. |
| Debugging Complexity | High | Mixing Symfony’s Messenger and Laravel’s Queue logs would obscure failure modes. |
| PHP Version Lock | Medium | Symfony 8.x requires PHP 8.4+; Laravel 10/11 max at 8.3, requiring either a PHP upgrade or Symfony downgrade. |
| Maintenance Burden | Critical | Custom adapters would need ongoing updates for both Symfony and Laravel releases. |
| Ecosystem Isolation | High | No native integrations with Laravel’s Horizon, Nova, or Forge, requiring custom builds. |
Why Symfony?
ScheduleProviderInterface) that Laravel’s scheduler lacks? (Laravel’s Schedule class already supports dynamic schedules via closures.)Business Justification
Alternatives Assessment
schedule:run) + Horizon for monitoring? (Yes—it’s the de facto standard.)Schedule class) suffice? (Likely yes, with less risk.)Long-Term Viability
Team Readiness
queue:work).schedule:run).#[AsCronTask]) via PHP 8+ attributes.ScheduleProviderInterface for dynamic runtime schedules.| Step | Action | Complexity | Risk |
|---|---|---|---|
| Assessment | Audit existing Laravel scheduler/queue usage. | Low | None |
| Prototype | Build a minimal Symfony Scheduler adapter for Laravel queues. | High | High (custom transport) |
| Dependency Injection | Bridge Symfony’s DI with Laravel’s container (e.g., via SymfonyBridge). |
Critical | High (version conflicts) |
| CLI Integration | Replace schedule:run with Symfony’s scheduler:consume. |
Medium | Medium (CLI overrides) |
| Event Mapping | Translate Symfony’s PostRunEvent to Laravel’s JobProcessed. |
High | Medium (debugging) |
| Testing | Write hybrid tests for Symfony + Laravel components. | Critical | High (CI overhead) |
| Deployment | Roll out in staging with feature flags for gradual adoption. | Medium | Medium (rollback risk) |
database/redis drivers.scheduler:consume conflicts with Laravel’s schedule:run.PostRunEvent does not align with Laravel’s JobProcessed.Phase 1: Proof of Concept (2-4 weeks)
Phase 2: Core Integration (4-8 weeks)
schedule:run with Symfony’s scheduler:consume (or hybrid mode).Phase 3: Ecosystem Integration (8-12 weeks)
PostRunEvent → Laravel Telescope).Phase 4: Deprecation of Legacy Scheduler (Ongoing)
Artisan::schedule() calls to Symfony’s #[AsCronTask].Recommendation: Abandon integration after Phase 1 unless Symfony-specific features are absolutely required. Laravel’s native tools are sufficient for 95% of use cases.
How can I help you explore Laravel packages today?