- What is laravelcollective/bus used for?
- laravelcollective/bus provides a command bus for Laravel that dispatches command objects to handlers, resolves handlers through the container, and supports a middleware pipeline and queued dispatch. It is a 2015 extraction of Laravel's command bus for legacy Laravel 4.2 or 5.0 applications. Modern Laravel already ships equivalent functionality in Illuminate\Bus, so the package has little or no architectural value on Laravel 5.1 and later.
- Is laravelcollective/bus still maintained?
- No. The repository is archived and has been unmaintained since December 2015, with no security patches, PHP 8 compatibility work, or Composer 2-era constraint updates. It is a frozen legacy artifact, not a dependency to add to active projects. Treat it as unsupported and plan an exit.
- Does laravelcollective/bus work with Laravel 8, 9, 10, 11, or 12?
- It does not work cleanly with Laravel 8 through 12. The package pins Illuminate and Symfony components from the 2015 era, so Composer resolution will either fail or force downgrades that break the framework. Laravel 5.1 and later already include Illuminate\Bus\Dispatcher, the dispatch() helper, ShouldQueue, and bus middleware, which are the correct replacements.
- How do I install laravelcollective/bus?
- Installation was historically composer require laravelcollective/bus, followed by registering the package's BusServiceProvider and optionally aliasing the dispatcher facade. That only makes sense on PHP 5.5 or 5.6 with Illuminate around 5.0. On modern PHP and Laravel, installation is a dependency-conflict generator, so do not attempt it.
- What is the difference between laravelcollective/bus and Illuminate\Bus?
- laravelcollective/bus is a standalone fork of the command bus that Laravel later shipped in the framework. Illuminate\Bus provides the maintained Dispatcher, the Illuminate\Contracts\Bus\Dispatcher contract, dispatch(), queued command support, and middleware. The package duplicates or shadows first-party classes and should be replaced with core classes.
- Can I use laravelcollective/bus in a non-Laravel PHP project?
- It is mechanically possible to wire the package into a non-Laravel PHP service with Illuminate components, but it is fragile because the dependency pins target PHP 5.5/5.6 and old Symfony versions. You would also need to provide container and handler-resolution wiring yourself. For a standalone command bus on modern PHP, prefer the maintained first-party illuminate/bus package.
- How do I migrate from laravelcollective/bus to Laravel's native command bus?
- Replace LaravelCollective\Bus imports with Illuminate\Bus and Illuminate\Contracts\Bus equivalents, remove the BusServiceProvider registration, and delete the Composer dependency. Map legacy SelfHandling and CommandHandler patterns to the framework's HandlerResolver, then verify that queued command payloads still serialize the same way. The refactor is mechanical but should be backed by tests around queue payloads and middleware ordering.
- What are alternatives to laravelcollective/bus?
- For Laravel applications, the direct alternative is the built-in command bus: Illuminate\Bus\Dispatcher, the dispatch() helper, ShouldQueue, and bus middleware. For non-Laravel PHP services, illuminate/bus is the maintained first-party option. A maintained fork of laravelcollective/bus is a fallback only for applications already pinned to Laravel 4.2 or 5.0.
- Is laravelcollective/bus safe for production?
- It is not safe for production on modern stacks. The package is archived, unmaintained since 2015, incompatible with PHP 8 patterns, and its old transitive dependencies are likely to fail composer audit. Mixing it with framework-native bus classes can also create duplicate dispatchers, inconsistent middleware ordering, and confusing queue semantics. Do not adopt it for greenfield or maintained applications.
- How do I test commands and handlers with laravelcollective/bus?
- The package does not provide modern testing helpers. On a legacy stack, test handlers directly and mock the dispatcher contract to assert that commands are dispatched. After migrating to Laravel's core bus, use Bus::fake() with assertDispatched() and assertDispatchedSync() to verify command dispatch and queued jobs without running them.