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
Laravel Cronless Schedule

Laravel Cronless Schedule Laravel Package

spatie/laravel-cronless-schedule

Run Laravel’s scheduler without cron. This dev/test-friendly package adds php artisan schedule:run-cronless, which uses a ReactPHP loop to execute the scheduler on a timer (default every minute), with optional custom frequency and manual runs.

View on GitHub
Deep Wiki
Context7

Run the Laravel scheduler without relying on cron

Frequently asked questions about Laravel Cronless Schedule
Can I use spatie/laravel-cronless-schedule in production instead of cron?
No, this package is not recommended for production. It lacks persistence across process restarts and distributed task coordination. For production, use Laravel Forge, Envoyer, or AWS EventBridge instead.
How do I install this package for local development?
Run `composer require spatie/laravel-cronless-schedule --dev` to install it as a dev dependency. Then execute `php artisan schedule:run-cronless` in your terminal to start the scheduler loop.
Will this work with Laravel 11?
Yes, the package supports Laravel 8.x through 11.x. Check the `composer.json` constraints in the package for exact version requirements.
Does this block HTTP requests or other PHP processes?
No, it uses ReactPHP’s event loop to run non-blockingly, allowing concurrent HTTP requests. However, avoid using it alongside other async PHP processes like Laravel Horizon without testing concurrency.
How do I test scheduled jobs in CI/CD (e.g., GitHub Actions)?
Add `php artisan schedule:run-cronless &` to your workflow, then simulate time with `sleep 60` in tests. Avoid relying on exact timing; use Laravel’s logging or `CronlessSchedule::getLastRunTime()` for verification.
What if my CI/CD environment kills the process (e.g., Kubernetes, serverless)?
The command runs indefinitely, so test SIGTERM handling in your environment. Use tools like PM2 or Docker’s `restart: unless-stopped` to manage process longevity.
Can I change the frequency from 1 minute?
Yes, pass a custom frequency in seconds via the `--frequency` option. For example, `php artisan schedule:run-cronless --frequency=30` runs every 30 seconds.
Will this work in Docker containers or serverless (AWS Lambda)?
Yes, it’s ideal for ephemeral environments. In Docker, run it as a detached process (`&`). In Lambda, ensure the timeout exceeds the loop’s duration (e.g., 60+ seconds).
How do I manually trigger a schedule run without waiting for the next interval?
Press Enter in the terminal where `schedule:run-cronless` is running to manually trigger an immediate execution of the scheduler.
Are there alternatives if ReactPHP is blocked (e.g., shared hosting)?
If ReactPHP or `pcntl` extensions are unavailable, consider using a lightweight cron emulator like `spatie/laravel-schedule-testing` for tests or stick to cron in production.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport