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

Async Command Laravel Package

enqueue/async-command

Symfony Console extension to run commands asynchronously by pushing execution requests to a message queue via Enqueue. Useful for offloading long-running tasks and integrating CLI workflows with MQ-based background processing.

View on GitHub
Deep Wiki
Context7

[READ-ONLY] This an extension for Symfony's Console. It allows async cli command execution.

Frequently asked questions about Async Command
Can I use this package to run Laravel Artisan commands asynchronously instead of Symfony commands?
No, this package is designed for Symfony’s Console component and won’t work directly with Laravel’s Artisan commands. You’d need to create a custom adapter layer to bridge Symfony’s `Command` interface with Laravel’s `Artisan::call()` or job-based execution. This adds complexity and isn’t recommended unless you have specific Symfony integration needs.
What Laravel queue drivers does this package support (Redis, database, etc.)?
This package relies on Enqueue’s transport layer (RabbitMQ, Redis, etc.), not Laravel’s native queue drivers. While you *could* use Redis as a shared backend, it introduces redundancy since Laravel already supports Redis/database queues natively. There’s no direct integration with Laravel’s `queue:work` or Horizon.
Is this package actively maintained for Laravel? The last release was in 2018.
No, the package is abandoned and lacks Laravel-specific support. The maintainer (Forma-Pro) focuses on Symfony/Enqueue, not Laravel. If you need async CLI tasks, Laravel’s built-in queues (`dispatch()`, `queue:work`) or Horizon are far more reliable and maintained. Consider forking or adapting the package yourself, but expect maintenance overhead.
How do I handle errors or failed async commands in Laravel?
Failed async commands won’t automatically appear in Laravel’s `failed_jobs` table since this package uses Enqueue’s error handling. You’d need to implement custom logic—like a queue listener—to log failures to Laravel’s database or another system. This requires additional setup compared to Laravel’s native queues.
Does this package offer performance benefits over Laravel’s `queue:work` for CLI tasks?
Unlikely. Laravel’s queues are optimized for PHP applications and integrate seamlessly with Artisan. Enqueue adds another layer (message serialization, transport overhead) without clear performance advantages. Benchmark your use case, but start with Laravel’s native queues unless you need Enqueue’s distributed orchestration features.
Can I use this with Laravel’s Redis queue driver instead of Enqueue’s Redis transport?
No, the package enforces Enqueue’s transport layer. While Redis is the common backend, the two systems (Laravel queues vs. Enqueue) aren’t interchangeable. You’d need to rewrite the queue consumer logic to use Laravel’s `RedisQueue` or `DatabaseQueue`, which defeats the package’s purpose.
What’s the best way to integrate this into a Laravel project if I still want to use it?
Wrap Symfony commands in a Laravel job using a facade or service. For example, create a `LaravelAsyncCommand` class that extends Symfony’s `Command` but dispatches a Laravel job instead of using Enqueue. This requires manual mapping of `InputInterface`/`OutputInterface` to Laravel’s job payloads and is not officially supported.
Are there alternatives to this package for async CLI tasks in Laravel?
Yes. Use Laravel’s native queues: dispatch a job with `dispatch(new MyCommandJob())` and run `queue:work`. For Artisan commands, create a scheduled job with `Artisan::command()` and the `Handle` trait. If you need distributed task orchestration, consider tools like Supervisor or Kubernetes instead of Enqueue.
How do I test async commands in Laravel using this package?
Testing is complex due to the Symfony-Laravel gap. Mock Enqueue’s transport layer in tests and verify job dispatching via Laravel’s queue listeners. Alternatively, test the Symfony command in isolation (without async) and assume the async layer works as documented—though this is risky given the package’s abandonment.
Will this package work with Laravel 10+ and Symfony 6+?
No. The package was last updated for Symfony 4.x and PHP 7.x. Laravel 10+ uses Symfony 6/7 components, which may introduce breaking changes. Even if you force compatibility, the lack of maintenance means unresolved bugs or security issues could arise. Laravel’s native queues are a safer bet for modern projects.
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.
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
spatie/mailcoach-vapor