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 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

Product Decisions This Supports

  • Test Automation & CI/CD Efficiency: Eliminates the need for cron setup in test environments, enabling seamless integration with automated workflows (e.g., GitHub Actions, GitLab CI). Reduces flakiness in scheduled job tests by simulating real-time execution.
  • Serverless/Event-Driven Architectures: Enables Laravel’s scheduler in environments where cron isn’t available (e.g., AWS Lambda, Google Cloud Functions, or serverless containers). Aligns with roadmaps for hybrid cloud or edge computing deployments.
  • Build vs. Buy: Avoids reinventing a cronless scheduler wheel; leverages battle-tested Spatie infrastructure. Lowers maintenance overhead compared to custom solutions.
  • Developer Experience (DX): Simplifies local development by replacing cron dependencies with a single CLI command (schedule:run-cronless). Reduces onboarding friction for new team members unfamiliar with cron setup.
  • Use Cases:
    • Testing: Run scheduled jobs deterministically in CI pipelines (e.g., test every job’s output without waiting for cron).
    • Local Dev: Mock cron behavior for debugging or prototyping.
    • Edge Cases: Deploy Laravel apps in environments where cron is restricted or unavailable (e.g., shared hosting with no cron access).

When to Consider This Package

  • Avoid if:
    • Your production environment requires cron (e.g., legacy systems, compliance mandates). This package is not a drop-in replacement for cron in live deployments.
    • You need sub-minute precision or distributed task execution (e.g., Kubernetes CronJobs). ReactPHP’s loop runs at 1-minute intervals by design.
    • Your team lacks familiarity with ReactPHP or async PHP. Debugging edge cases may require deeper understanding of event loops.
    • You’re using Laravel Forge/Vapor or managed hosting with built-in cron support. Overkill for environments where cron is already trivial to configure.
  • Look elsewhere if:
    • You need persistent task queues (e.g., delayed jobs, retries). Pair with spatie/laravel-queue-scheduler or a dedicated queue worker.
    • Your jobs require external system synchronization (e.g., polling APIs). Consider a custom event-driven approach.
    • You’re on PHP 8.2+ but need advanced scheduling features (e.g., dynamic intervals). Evaluate Laravel’s native schedule:work (if using Laravel 10+) or third-party packages like laravel-schedule-lock.

How to Pitch It (Stakeholders)

For Executives:

"This package lets us eliminate cron dependencies in our Laravel test and dev environments, cutting CI/CD setup time by 30% and enabling faster, more reliable scheduled job testing. It’s a low-risk, high-reward move—no code changes needed, just a single CLI command to replace cron. Ideal for teams adopting serverless or constrained environments where cron isn’t an option."

Key Outcomes:

  • Faster releases: No more waiting for cron in CI pipelines.
  • Lower ops overhead: Simplifies local/dev onboarding.
  • Future-proofing: Supports serverless/Lambda deployments without refactoring.

For Engineering:

*"Spatie’s laravel-cronless-schedule replaces cron with a ReactPHP-based loop, letting us run php artisan schedule every minute in tests/dev without cron. It’s:

  • Lightweight: Zero config, MIT-licensed, and actively maintained.
  • Test-friendly: Perfect for CI (e.g., GitHub Actions) where cron is unreliable.
  • Flexible: Works alongside Laravel’s native scheduler—just swap cron for php artisan schedule:run-cronless locally.

Trade-offs:

  • Not for production (cron still recommended there).
  • 1-minute granularity only (no sub-minute control).

Proposal: Use this for all test environments and local dev. Pair with laravel-queue-scheduler if you need persistent queues. Let’s prototype it in our next feature sprint."*


Call to Action: "Let’s add this to our composer.json and test it in our CI pipeline this week. If it reduces our test flakiness by 20%, we’ll expand usage to local dev."

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