litvinab/cron-event
A lightweight Laravel package for defining and managing cron-based events. Schedule recurring tasks with cron expressions, attach custom event logic, and keep jobs organized alongside Laravel's scheduler for simpler automation.
This package is a Laravel/PHP scheduling component with a deliberately narrow v1.0 scope: MongoDB-only persistence, two event types (Event, Timer), and two console commands (cron:run, cron:list). For a TPM, the main value is a lightweight, Laravel-native way to define and inspect scheduled work backed by MongoDB, but the MongoDB-only constraint is the dominant architectural decision.
Architecture fit: Good fit only where MongoDB is already an approved operational datastore or where introducing it is justified by broader platform needs. It is a poor fit for standard Laravel stacks standardized on MySQL/PostgreSQL unless the team is prepared to add MongoDB solely for scheduling. The Event/Timer model appears simple enough for basic scheduled jobs, but the limited event taxonomy may not cover complex recurrence, dependency chains, or business-calendar scheduling without custom work.
Integration feasibility: Feasible for a Laravel team familiar with service providers, console commands, and the Laravel scheduler. Integration likely requires configuring a MongoDB connection, defining schedule records, and invoking cron:run from the host scheduler or a worker. The cron:list command is useful for operational visibility during rollout.
Technical risk: Medium. Key risks are the MongoDB-only dependency, immature v1.0 surface area, unclear concurrency/locking behavior for multi-node deployments, unclear retry/idempotency semantics, and limited event types. Because only Event and Timer are listed, the package may not yet support richer scheduling patterns or integrations expected in mature scheduler packages.
Key questions: Which Laravel and PHP versions are supported? Which MongoDB server and PHP MongoDB extension versions are required? How does cron:run prevent duplicate execution across multiple app nodes? Are jobs retried, and how are failures recorded? How are time zones, daylight-saving transitions, and missed runs handled? What is the persistence schema and migration/upgrade strategy? Is there observability for run history, duration, and failures? What security model protects schedule definitions and command execution?
Stack fit: Best suited to a Laravel service already using MongoDB and needing a small, inspectable scheduling layer. For teams on relational databases, treat this as a strategic dependency decision rather than a drop-in scheduler replacement.
Migration path: Start with a proof of concept in a non-critical environment. Configure a dedicated MongoDB database/collection, port a small set of low-risk scheduled jobs, define them as Event or Timer, confirm visibility through cron:list, and execute through cron:run under controlled conditions. Compare behavior against the existing Laravel scheduler before expanding scope.
Compatibility: Validate Laravel version, PHP version, MongoDB driver/extension, MongoDB server version, and deployment model. Confirm whether the package expects a single scheduler host or supports distributed workers. Confirm command exit codes and logging behavior so existing alerting can consume them.
Sequencing: First, confirm MongoDB approval and operational ownership. Second, build a small job inventory and map each job to Event or Timer. Third, implement a pilot with one or two jobs. Fourth, add runbooks for cron:list inspection and cron:run execution. Fifth, run in parallel/shadow mode where possible. Finally, cut over only after concurrency, failure, and rollback behavior are proven.
Maintenance: v1.0 implies an early package with a small API surface. Maintenance burden is low if MongoDB is already supported, but the package becomes a critical dependency for scheduled work. The team must own MongoDB backups, indexes, access control, and schema evolution around schedule data.
Support: Confirm maintainer activity, documentation quality, issue responsiveness, and whether the package is internal or community-supported. The TPM should require a documented escalation path and a clear statement of supported Laravel/PHP/MongoDB versions.
Scaling: Horizontal scaling depends on how cron:run handles locking and overlap. Multiple app nodes invoking the command simultaneously could cause duplicate execution unless the package or deployment enforces a single runner or distributed lock. MongoDB indexes and collection growth should be planned, especially if run history or many timers are stored.
Failure modes: Likely failure modes include MongoDB unavailability, duplicate runs across nodes, missed timers due to scheduler or clock issues, timezone/DST errors, long-running jobs blocking subsequent runs, silent command failures, and lack of retry visibility. The TPM should require alerting on command failures, run duration, missed schedules, and MongoDB health.
Ramp-up: Ramp-up is moderate for Laravel developers and higher for teams unfamiliar with MongoDB operations. Enablement should cover the Event/Timer model, cron:list and cron:run usage, deployment topology, locking assumptions, failure handling, and rollback procedures. A short pilot with clear success criteria is the right adoption path.
How can I help you explore Laravel packages today?