Weave 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
Command Bus

Command Bus Laravel Package

rezzza/command-bus

rezzza/command-bus provides a lightweight command bus for PHP and Laravel applications. Dispatch commands to dedicated handlers, add middleware for cross-cutting concerns, and keep business logic decoupled, testable, and easy to organize.

Deep Wiki
Context7

rezzza/command-bus provides a lightweight command bus for PHP applications, helping keep controllers and services thin by dispatching commands to dedicated handlers. It makes write operations explicit, decoupled, and easier to test.

  • Clean command-to-handler dispatch
  • Dedicated handlers for application logic
  • Simple, framework-agnostic API
  • Testable, decoupled architecture
  • Easy to integrate into existing PHP apps
Frequently asked questions about Command Bus
What is rezzza/command-bus used for?
It is a lightweight command bus for PHP and Laravel that maps command objects to dedicated handler classes. This helps move business logic out of controllers and into explicit command and handler classes. It also supports middleware, so you can add cross-cutting behavior around command handling.
How do I install rezzza/command-bus in Laravel?
Install it with Composer using composer require rezzza/command-bus. In a Laravel application, you typically register the package service provider if one is provided and configure the command-to-handler mappings in a service provider. Check the package README for the exact provider class and configuration steps for your version.
How do I map a command to its handler?
Mapping is done by associating each command class with its handler class, usually through configuration or a service provider registration. When the command bus dispatches a command, it resolves the matching handler and invokes it. The exact mapping syntax depends on the package version, so follow the README examples.
Does rezzza/command-bus support middleware?
Yes, the package supports middleware around command handling. Middleware lets you run logic before or after a command is handled, such as transactions, logging, authorization, or validation. You register middleware in the bus configuration and they execute in the order you define.
Which Laravel versions are supported?
The package is described as a lightweight command bus for PHP/Laravel, but the provided context does not list specific Laravel version constraints. Check the package composer.json and README for the supported PHP and Laravel versions before installing. That is especially important if you are upgrading an existing Laravel application.
Can I use rezzza/command-bus outside Laravel?
Yes, it is described as a lightweight command bus for PHP/Laravel, so the core bus is usable in plain PHP applications. Laravel integration adds convenience for service resolution and configuration, but the command and handler pattern does not require the framework. You would wire the bus and handler mappings manually in a non-Laravel app.
How do I test commands and handlers with this package?
You can unit test handlers directly by instantiating them with mocked dependencies and calling their handle method. For integration tests, dispatch commands through the command bus and assert the expected side effects or responses. Middleware can also be tested by registering test middleware and verifying it runs around the handler.
Is rezzza/command-bus suitable for production?
It is a lightweight library intended to organize business logic into command and handler classes, which can be used in production Laravel applications. Before deploying, verify the package's maintenance status, PHP/Laravel compatibility, and test coverage for your use case. Also review how you handle transactions and failures in middleware.
What are alternatives to rezzza/command-bus?
Alternatives include other PHP command bus packages such as Tactician, SimpleBus, and Laravel-focused bus implementations built around Laravel's container and pipeline. Some teams also use Laravel jobs or action classes instead of a dedicated command bus. The best choice depends on whether you need middleware, strict command-handler mapping, and framework independence.
Is rezzza/command-bus actively maintained?
The provided context does not include repository activity or release history, so maintenance status cannot be confirmed from this information alone. Check the package on Packagist and its repository for recent commits, releases, and open issues. If maintenance is stale, confirm compatibility with your Laravel version before adopting it.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections