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 Artisan Dispatchable Laravel Package

spatie/laravel-artisan-dispatchable

Register Laravel jobs as Artisan commands by implementing the ArtisanDispatchable interface. Dispatch queued jobs via CLI (e.g., php artisan process-podcast) so long-running tasks won’t block the scheduler, while remaining runnable from Artisan.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Asynchronous Task Execution: Enables long-running or resource-intensive tasks (e.g., data processing, batch operations, or external API calls) to run asynchronously via Laravel’s queue system, preventing delays in scheduled tasks.
  • CLI-Driven Workflows: Supports CLI-first development by allowing jobs to be triggered via Artisan commands, improving developer experience and enabling manual testing/debugging.
  • Hybrid Scheduling: Bridges the gap between Laravel’s scheduler (for short, synchronous tasks) and queue workers (for long, asynchronous tasks), reducing complexity in task orchestration.
  • Roadmap for Scalability: Future-proofs the system for scaling background jobs without rewriting scheduling logic, especially for teams migrating from cron-based solutions.
  • Build vs. Buy: Avoids reinventing wheel for job dispatching via CLI, leveraging a battle-tested, lightweight package with minimal maintenance overhead.

When to Consider This Package

  • Use this when:
    • You have long-running tasks (>1 minute) that would block Laravel’s scheduler if run synchronously.
    • Your team prefers CLI-driven workflows for background jobs (e.g., debugging, ad-hoc execution).
    • You want to decouple job execution from HTTP requests (e.g., for CLI-based APIs or internal tools).
    • You’re already using Laravel’s queue system and need a seamless way to dispatch jobs via Artisan.
  • Look elsewhere if:
    • Your tasks are short-lived (<1 minute) and can safely run synchronously in the scheduler.
    • You need advanced job orchestration (e.g., retries, chaining, or event-based triggers) beyond what Laravel’s queue system offers (consider packages like spatie/laravel-backup or custom solutions).
    • Your team lacks familiarity with Laravel’s queue system or Artisan commands.
    • You require real-time progress tracking or user-facing job status (consider spatie/laravel-job-monitor).

How to Pitch It (Stakeholders)

For Executives: "This package lets us run long, resource-heavy tasks (like data migrations or batch processing) in the background without slowing down our scheduled jobs. It’s like giving our CLI tools superpowers—we can trigger jobs manually via commands or automate them via Laravel’s scheduler, all while keeping our system responsive. It’s a low-risk, high-reward upgrade that reduces technical debt and improves reliability."

For Engineering: *"Spatie’s laravel-artisan-dispatchable lets us dispatch queue jobs directly from Artisan commands with zero boilerplate. Perfect for:

  • Debugging: Run a job manually (php artisan process-podcast) instead of waiting for the scheduler.
  • Scalability: Offload long tasks to the queue without blocking other scheduled jobs.
  • Consistency: Reuse existing job logic for both CLI and automated workflows. It’s MIT-licensed, actively maintained, and integrates seamlessly with Laravel’s ecosystem. Let’s prototype it for [X use case]—the setup is trivial, and the benefits are immediate."*
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