Weave 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

Cron Event Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Current symfony2 bundle generates events inside the application based on timers stored in DB.

Frequently asked questions about Cron Event
What is litvinab/cron-event and how does it work with Laravel's event system?
litvinab/cron-event is a lightweight Laravel package that lets you define recurring tasks as events using standard cron expressions. Each registered event is evaluated during the scheduler run and dispatched through Laravel's event dispatcher when its expression matches. This keeps timing logic close to the event classes and handlers that do the work instead of spreading it across console commands.
How do I install litvinab/cron-event with Composer in a Laravel app?
Install it with Composer using the package name litvinab/cron-event. Because it is a Laravel package, you will typically rely on package discovery or register its service provider according to the README. After installation, configure the required MongoDB connection and register your scheduled events through the package's registration API.
Does litvinab/cron-event require MongoDB, or can I use MySQL or PostgreSQL?
The technical assessment states that this package is MongoDB-only for persistence in its v1.0 scope. It is therefore not a drop-in scheduler replacement for standard Laravel stacks built on MySQL or PostgreSQL. Use it where MongoDB is already an approved operational datastore, or treat adding MongoDB solely for scheduling as a deliberate architectural decision.
Which Laravel and PHP versions are supported by litvinab/cron-event?
The provided overview does not list exact Laravel or PHP version constraints. Before adopting it, confirm the supported Laravel and PHP versions in the package README and composer.json. Also validate the required MongoDB server version and PHP MongoDB extension version for your deployment environment.
How do I define a recurring event with a cron expression using this package?
You define scheduled work as event classes and register them with the package using familiar cron expressions. During the scheduler run, each registered event is evaluated and dispatched automatically when its expression matches. The exact registration API should be confirmed in the README before implementing production jobs.
What is the difference between Event and Timer in litvinab/cron-event?
The v1.0 scope lists two event types, Event and Timer, but the provided overview does not detail their exact behavioral differences. Confirm the intended use cases for each type in the package documentation before mapping production jobs. The limited event taxonomy may not cover complex recurrence, dependency chains, or business-calendar scheduling without custom work.
How do the cron:run and cron:list commands work in production?
The cron:run command evaluates registered cron-based events and dispatches the ones whose expressions match. The cron:list command provides operational visibility into the registered schedules, which is useful during rollout and routine inspection. In production, cron:run is typically invoked from the host scheduler or a worker, so confirm exit codes and logging behavior for existing alerting.
Can litvinab/cron-event prevent duplicate job execution across multiple Laravel nodes?
The provided materials do not specify the package's concurrency or locking behavior for multi-node deployments. This is a key risk to validate before running cron:run on more than one application node. Test whether the package prevents duplicate dispatch or whether you need to enforce a single scheduler host or external locking.
How are failed jobs, retries, time zones, and missed runs handled?
The overview does not define retry, failure-recording, time zone, daylight-saving, or missed-run semantics. Before production use, confirm how failures are recorded, whether jobs are retried, and how schedules behave across time zone changes. Also verify whether cron:run exposes run history, duration, and failure details for observability.
When should I use litvinab/cron-event instead of Laravel's built-in scheduler?
Use litvinab/cron-event when your Laravel service already uses MongoDB and you want a small, inspectable scheduling layer that keeps recurring task logic in dedicated event classes. For teams standardized on relational databases, Laravel's built-in scheduler is usually the safer default unless MongoDB is approved for broader platform needs. Treat this package as a strategic dependency decision and pilot it against your existing scheduler before expanding scope.
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.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core