Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Cadence Laravel Package

directorytree/cadence

Cadence adds model-based scheduling to Laravel. Attach one or more cron or RRULE schedules to any Eloquent model, track due runs, and dispatch events when schedules trigger. Driver-based design supports cron, php-rrule, Recurr, or custom drivers.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Dynamic Workflow Automation: Enables scheduling of actions tied to Eloquent models (e.g., "generate a report for this Campaign every Monday at 9 AM"), reducing reliance on static cron jobs or external services. This directly supports feature flags for time-sensitive functionalities (e.g., compliance checks, user-specific notifications) without requiring separate infrastructure.
  • Roadmap Prioritization: Justifies investment in recurring task automation (e.g., batch processing, analytics, or user engagement workflows) by providing a scalable, maintainable solution. Aligns with initiatives to reduce manual intervention in operational tasks.
  • Build vs. Buy: Avoids reinventing scheduling logic while offering extensibility (custom drivers, event listeners) without vendor lock-in. The MIT license ensures compliance and flexibility, making it a low-risk, high-reward choice compared to proprietary solutions.
  • Use Cases:
    • Model-Driven Scheduling: Attach schedules to any Eloquent model (e.g., Subscription, Invoice, User), enabling granular control over when actions occur. Ideal for user-specific automation (e.g., "send a reminder to this User every 7 days").
    • Multi-Timezone Support: Schedule events in user-specific or regional timezones (e.g., "send a reminder at 9 AM local time"), critical for global applications or SaaS platforms.
    • Event-Driven Architecture: Decouple scheduling from business logic via ScheduleTriggered events, enabling async processing (e.g., queue jobs, send emails) and observability. Supports microservices architectures where scheduling logic is decoupled from execution.
    • Complex Recurrence Rules: Support for RRULE (via php-rrule or Recurr) allows for advanced scheduling (e.g., "every 3rd Friday of the month" or "last day of the month"), addressing edge cases that cron expressions struggle with.
    • Custom Logic: Extend with domain-specific drivers (e.g., "run every 7 days after order creation") or configure underlying libraries (e.g., tweak php-rrule behavior for edge cases). Enables tailored solutions without sacrificing maintainability.

When to Consider This Package

  • Adopt if:

    • Your Laravel application requires model-specific scheduling (e.g., schedules tied to User, Order, or Campaign instances) where actions must be triggered based on dynamic data.
    • You need flexible recurrence rules (cron or RRULE) to handle both simple and complex scheduling scenarios without sacrificing maintainability.
    • Your workflows benefit from event-driven execution (e.g., triggering jobs, notifications, or analyses when schedules fire), enabling async processing and observability.
    • You’re using Laravel 11+ and PHP 8.2+, ensuring compatibility with modern Laravel features and reducing integration risks.
    • You want to avoid cron complexity (e.g., managing server cron jobs, parsing expressions) while retaining control over scheduling logic in a centralized, application-aware system.
    • Your team can dedicate time to integrate event listeners, set up the schedules:run command in your deployment pipeline, and maintain the scheduling logic long-term.
  • Look elsewhere if:

    • Your use case involves simple, system-wide tasks (e.g., cache clearing, log rotation) where Laravel’s built-in Schedule facade or server cron is sufficient and overkill for this package.
    • You lack developer resources to implement event listeners, migrations, or the schedules:run command, as Cadence requires active integration into your application’s workflow.
    • You require serverless or distributed scheduling (e.g., AWS EventBridge, Cloud Scheduler, or Kubernetes CronJobs), as Cadence assumes a Laravel app instance is always running to process schedules.
    • Your project uses legacy Laravel versions (pre-11) or PHP < 8.2, requiring significant upgrades to meet compatibility requirements.
    • You need GUI management for schedules (consider Laravel Nova, custom admin panels, or third-party tools like Laravel Horizon for queue-based scheduling or Laravel Backups for cron-like tasks).

How to Pitch It (Stakeholders)

For Executives: "Cadence is a model-based scheduling system for Laravel that transforms how we automate time-sensitive workflows—like generating reports, sending notifications, or running analyses—directly within our application. Instead of relying on external cron jobs or manual processes, we can now schedule actions tied to specific data models (e.g., ‘generate an invoice for this Subscription every month’ or ‘send a reminder to this User at 9 AM in their local timezone’). This reduces operational overhead, minimizes missed deadlines, and scales with our business needs. It’s a low-risk investment: open-source (MIT license), actively maintained, and built for Laravel, so it integrates seamlessly with our existing stack. The result? Fewer manual processes, more reliable automation, and the flexibility to adapt schedules as our use cases evolve."

For Engineering: *"Cadence replaces fragmented cron jobs with a unified, model-aware scheduler that’s event-driven and extensible. Here’s why it’s a game-changer for us:

  • Polymorphic Schedules: Attach schedules to any Eloquent model (e.g., Report::find(1)->addSchedule()), giving us fine-grained control over when actions fire—no more guessing which cron job handles what.
  • Driver Flexibility: Choose cron for simplicity or RRULE (via php-rrule or Recurr) for complex recurrence (e.g., ‘every 3rd Friday’ or ‘last day of the month’), covering edge cases cron can’t handle.
  • Timezone Support: Schedule events in user/local timezones via Carbon, which is critical for global applications or SaaS platforms where ‘9 AM’ means different things to different users.
  • Event-Driven: Trigger actions via ScheduleTriggered events, which we can queue, log, or observe—perfect for async workflows or microservices where scheduling and execution are decoupled.
  • Custom Logic: Extend with domain-specific drivers or tweak underlying libraries (e.g., configure php-rrule for edge cases), ensuring we’re not locked into one-way scheduling.
  • Maintainability: Centralized logic in the app means no more hunting through server cron files or parsing cron expressions. Migrations, event listeners, and the schedules:run command give us full control over how schedules are processed.

Trade-offs:

  • Requires upfront setup (migrations, event listeners, schedules:run command in your scheduler).
  • Assumes a Laravel instance is always running (not ideal for serverless or ephemeral environments).
  • Best for model-specific automation; simpler tasks may still be better suited to Laravel’s built-in scheduler.

Next Steps:

  1. Proof of Concept: Integrate Cadence for one high-impact use case (e.g., scheduling report generation for Campaign models) to validate the setup and performance.
  2. Event Listeners: Design how ScheduleTriggered events will map to our existing job queues or services.
  3. Deployment: Ensure the schedules:run command is added to our scheduler and runs reliably (e.g., every minute via Laravel’s task scheduler).
  4. Monitoring: Set up observability (e.g., log triggered schedules, track failures) to ensure reliability in production.

This is a strategic upgrade from ad-hoc cron to a scalable, maintainable system that grows with our application."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky