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

Cron Laravel Package

effiana/cron

A Laravel package for managing and running cron-style scheduled tasks within your application. Define jobs, configure timing, and trigger execution from the CLI or scheduler, providing a simple way to centralize recurring task automation in Laravel.

View on GitHub
Deep Wiki
Context7

Cronjobs

Frequently asked questions about Cron
How do I install effiana/cron in a Laravel 9.x project?
Run `composer require effiana/cron` in your project directory. The package integrates via Laravel’s service container, so no additional configuration is needed unless you’re using custom job classes. Ensure your PHP version is 8.0+ for compatibility with dependencies like dragonmantank/cron-expression.
Can I use effiana/cron to replace Laravel’s built-in scheduler (schedule:run)?
No, this package is not a drop-in replacement for Laravel’s scheduler. It lacks native queue integration and real-time execution. Use it for lightweight, non-blocking tasks where you need dynamic cron expressions or avoid external cron files, but rely on `schedule:run` for queue-backed jobs.
What’s the difference between effiana/cron and manually writing cron expressions in a file?
This package lets you define and manage cron jobs programmatically in PHP, avoiding the need for external cron files. You can generate expressions dynamically (e.g., based on user input) and trigger jobs via CLI commands or HTTP endpoints, whereas traditional cron requires editing system files.
Does effiana/cron support timezones for scheduled jobs?
Yes, you can specify timezones when creating cron expressions, but you must handle timezone logic manually in your job classes. The package uses PHP’s DateTime under the hood, so ensure your server’s timezone settings align with your application’s expectations.
How do I trigger jobs scheduled with effiana/cron?
Jobs aren’t executed automatically—you must poll the API manually, typically via a Laravel command or an external cron job calling a route. For example, create a command like `php artisan run:scheduled-jobs` to iterate through pending jobs and execute them.
Is effiana/cron compatible with Laravel 10.x and PHP 8.2?
The package hasn’t been updated since 2020, so compatibility isn’t guaranteed. Test thoroughly in a staging environment, especially for dependencies like dragonmantank/cron-expression. If issues arise, you may need to fork the package or use a maintained alternative.
Can I use effiana/cron for high-frequency jobs (e.g., every minute) in production?
Yes, but polling-based execution may introduce latency or server load. For high-frequency jobs, consider combining this package with a lightweight Laravel command that runs every minute (e.g., via a system cron job) to check and execute pending tasks.
How do I handle failed jobs or implement retries with effiana/cron?
The package doesn’t include built-in retry logic or failure handling. You’ll need to implement this manually, such as by logging failed jobs to a database table and writing a separate command to retry them. Consider integrating with Laravel’s queue system for more robust error handling.
Are there alternatives to effiana/cron for dynamic cron scheduling in Laravel?
Yes, consider Laravel’s native `schedule()` method for queue-backed jobs, or packages like `spatie/scheduler` for more advanced features. If you need dynamic expressions without queues, you could also build a custom solution using PHP’s CronExpression library directly.
How can I test cron jobs defined with effiana/cron in my Laravel tests?
Mock the cron expression parsing and job execution logic in your unit tests. Use PHPUnit to verify that jobs are added to the correct cron instances and that expressions are parsed as expected. For integration tests, simulate the polling mechanism by manually triggering job execution via a test command.
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