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

Laravel Short Schedule Laravel Package

spatie/laravel-short-schedule

Schedule Laravel Artisan commands at sub-minute intervals (every second or even fractions) via ShortSchedule in routes/console.php or the console kernel. Note: Laravel 11+ now supports sub-minute scheduled tasks, so this package is largely obsolete.

View on GitHub
Deep Wiki
Context7

Note: Laravel’s Scheduler now supports sub-minute scheduled tasks, so this package is largely obsolete for new projects.

spatie/laravel-short-schedule enables running Laravel Artisan commands at sub-minute intervals (e.g., every second or even fractions of a second) via a simple fluent API. Define short-interval tasks in routes/console.php using the ShortSchedule facade, or in your console kernel’s shortSchedule() method.

  • Schedule commands every second, every N seconds, or sub-second (e.g., 0.5)
  • Use facade or Kernel integration for configuration
  • Run both command strings and command classes (auto signature discovery)
  • Minimal setup, designed to complement Laravel’s native scheduler
Frequently asked questions about Laravel Short Schedule
Is spatie/laravel-short-schedule still needed for Laravel 11+ projects?
No, Laravel 11+ natively supports sub-minute scheduling, making this package obsolete for new projects. However, it may still be useful for legacy Laravel 10 or older systems requiring sub-second precision.
How do I install and configure ShortSchedule in Laravel?
Run `composer require spatie/laravel-short-schedule`, then add commands to `routes/console.php` or the `shortSchedule` method in `app/Console/Kernel.php` using methods like `everySecond()` or `everySeconds(30)`. Ensure Supervisor is configured to run the scheduler.
What Laravel versions does this package officially support?
The package is officially supported for Laravel 13 (PHP 8.3+). Laravel 10/11 are unsupported, though minor tweaks might make it work. For Laravel 11+, use the native scheduler instead.
Can I schedule commands with sub-second precision (e.g., every 0.5 seconds)?
Yes, the package supports fractional seconds (e.g., `everySeconds(0.5)`). However, ReactPHP’s event loop may introduce slight latency, so test thoroughly for time-sensitive applications.
How does ShortSchedule handle overlapping or concurrent executions?
Use the `withoutOverlapping()` method to prevent overlapping executions of the same command. This is useful for idempotent operations like rate-limited API calls or real-time data processing.
Will this package work with Lumen or non-Laravel PHP applications?
Lumen support is limited—you’ll need to manually copy the command logic. For non-Laravel PHP apps, the package isn’t designed for direct use, as it relies on Laravel’s Artisan and service container.
How do I monitor or debug tasks scheduled with ShortSchedule?
Debugging is more complex than traditional cron jobs due to ReactPHP’s non-blocking nature. Use Laravel’s logging, Supervisor logs, and the `ShortScheduledTaskStarting` event to track executions. Avoid long-running event listeners to prevent task delays.
Are there performance or resource concerns with high-frequency tasks?
Yes, spawning processes for sub-second tasks can increase CPU/memory usage. ReactPHP’s event loop may struggle with >100 tasks/sec without optimization. Monitor process counts and consider batching tasks if possible.
Can I run ShortSchedule tasks in maintenance mode?
By default, tasks skip maintenance mode. To override this, use `whenNotInMaintenance()` or explicitly allow them in your configuration. This is useful for critical background tasks during deployments.
What are the alternatives to ShortSchedule for sub-minute scheduling?
For Laravel 11+, use the native scheduler’s sub-minute support. For older versions, consider custom cron entries with `*` syntax (e.g., `* * * * * *`) or third-party tools like `cron-plus` or `systemd timers`. Each has trade-offs in precision and complexity.
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