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

Bus Laravel Package

alt-three/bus

Alt Three Bus is a lightweight command bus for Laravel that dispatches commands to handlers, supports middleware, and integrates with the container to keep business logic clean and decoupled.

View on GitHub
Deep Wiki
Context7

Alt Three Bus is a lightweight command bus for Laravel that separates request handling from application logic. It dispatches commands to registered handlers through Laravel’s container, helping keep controllers and services thin while organizing complex operations into single-purpose classes.

  • Command dispatching with automatic handler resolution
  • Middleware pipeline for validation, logging, and transactions
  • Queued commands for deferring work to Laravel’s queue system
  • Test-friendly architecture with explicit handler wiring
  • Seamless Laravel integration and configuration
Frequently asked questions about Bus
What is AltThree/Bus and what problem does it solve in Laravel?
AltThree/Bus is a thin opinionated layer over Laravel's native command bus that dispatches Command objects to handler classes through a container-aware middleware pipeline. It is meant to move request-shaped concerns such as validation and authorization next to the write operation they guard, instead of leaving them in controllers. The package does not add a broker, serializer, or new transport; dispatch is in-process and synchronous unless you also queue it. In practice it is a CQRS-lite structuring tool for organizing application actions.
Which Laravel and PHP versions does AltThree/Bus support?
The last release was on 2020-07-25, and the repository is archived. That release window corresponds to Laravel 5.x through 7.x and PHP 7.x. It is not a supported choice for Laravel 9, 10, or 11 on PHP 8.1+, where you should expect Composer conflicts on illuminate/* constraints and possible runtime breakage if force-installed. Adopting it on a current framework line means forking or vendoring, not simply requiring it.
How do I install and register AltThree/Bus?
Installation is a normal Composer require for alt-three/bus on a compatible Laravel version, followed by service provider registration. On Laravel 5.5 and later the provider should be auto-discovered; on older versions you register it manually in config/app.php. After that you define Command and Handler classes and dispatch through the bus. There is no infrastructure, schema change, or new runtime to set up.
How does the AltThree/Bus middleware pipeline work?
The package wraps Laravel's dispatcher with a middleware pipeline around command handling, so cross-cutting steps run before or after the handler. Its common use is validation and authorization middleware that let a Command object declare its own rules() and authorize() logic. Handlers are resolved through the service container, which keeps command and handler logic separated. Middleware ordering is important, especially if you add transaction wrapping, logging, or policy checks.
Is AltThree/Bus still maintained and safe for production?
No, it is archived with no security response, compatibility patches, or issue triage. It has zero dependents, low adoption, and little battle-tested production signal, so there is no ecosystem pressure to keep it working with newer Laravel releases. For a current production application, the safer path is to reimplement the same pattern on supported framework APIs or fork and vendor the package with a clear owner. Silent divergence from framework behavior after upgrades is the main concern.
Can I use AltThree/Bus with Laravel 10 or Laravel 11?
Realistically, no. Its last release targets the Laravel 5.x to 7.x and PHP 7.x era, so Composer will usually reject it against Laravel 10 or 11 because of illuminate/* version constraints. Force-installing it risks runtime breakage from internal dispatcher changes. If you need this developer experience today, build a small internal package around Laravel's native dispatcher instead.
How do I test commands and handlers with AltThree/Bus?
Handlers are plain classes resolved from Laravel's container, so you can instantiate them directly in unit tests and mock their dependencies. Dispatch integration tests can go through the bus to confirm the correct handler runs and middleware behaves as expected. Validation and authorization middleware can be tested separately from the handler logic. Because the package is archived, keep tests close to your own wrapper so framework upgrades expose any divergence quickly.
Does AltThree/Bus support queued or asynchronous commands?
The package itself does not introduce a broker, serializer, or new transport; dispatch is in-process and synchronous by default. It is a thin layer over Laravel's native dispatcher, so any queueing would have to come from Laravel's queue integration and should be verified carefully on a forked version. If your application needs reliable async command handling, the native bus plus your own contract is a better starting point.
What are alternatives to AltThree/Bus for command bus patterns in Laravel?
The strongest alternative is Laravel's native command bus with pipeThrough middleware and a small internal Command and Handler contract. That gives you validation, authorization, transaction, and logging middleware without a third-party dependency. Reimplementing the AltThree/Bus shape is roughly a one-day task and keeps you on supported framework APIs. For greenfield work, avoid archived packages that duplicate native capability.
How do I migrate from AltThree/Bus to Laravel's native command bus?
Create an internal package or namespace with a Command base class exposing rules() and authorize(), a Handler contract, and a dispatcher wrapper that calls app(Dispatcher::class)->pipeThrough([ValidateCommand::class, AuthorizeCommand::class]). Move your existing middleware behavior into those classes and replace the AltThree/Bus service provider registration. Then update dispatch call sites and run handler, middleware, and integration tests. This preserves the developer experience while removing the archived dependency.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console