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

Service Bus Laravel Package

prooph/service-bus

Prooph Service Bus is a PHP messaging library for command, query, and event buses. It provides middleware, message routing, and flexible transports for building CQRS and event-driven applications with clean separation of concerns.

Deep Wiki
Context7

Technical Evaluation

Architecture fit
prooph/service-bus is a framework-agnostic PHP message bus for CQRS-style command, query, and event dispatching. It fits a Laravel application only when the domain architecture already values explicit message boundaries, handler isolation, and middleware pipelines. In a conventional Laravel CRUD or simple service-layer app, it duplicates Laravel’s native command bus, events, and queue abstractions and adds conceptual overhead. Best fit: modular monolith or DDD-oriented bounded context where commands/queries need consistent dispatch semantics and middleware such as validation, authorization, transaction handling, and logging.

Integration feasibility
Feasible but not turnkey. Laravel can install it via Composer and wire buses through a service provider, but there is no first-party Laravel integration. A TPM should expect custom work for container-aware handler resolution, message factory adaptation, middleware configuration, transaction boundaries, and async transport if needed. The package is synchronous by default; async execution requires bridging to Laravel queues, Symfony Messenger, Enqueue, or a custom transport with idempotency and dead-letter handling.

Technical risk
Primary risk is lifecycle: last release was 2021-08-25, so PHP 8.2/8.3/8.4 and modern Laravel compatibility must be proven with a dependency spike. The prooph ecosystem has limited recent activity and a smaller talent pool. Additional risk comes from middleware ordering, hidden coupling to prooph message interfaces, serialization/versioning of messages, and unclear transaction semantics once asynchronous transports are introduced. BSD-3-Clause is permissive, which helps if a fork or internal patch is required.

Key questions

  • Which Laravel and PHP versions must be supported, and does the Composer dependency graph resolve cleanly?
  • Is the application already DDD/CQRS-oriented, or is this being introduced for the first time?
  • Are commands/queries synchronous in-process, or is durable async messaging required?
  • Who owns upgrades, forks, and security patching if upstream remains inactive?
  • What transaction, idempotency, retry, and observability semantics are required?
  • Can the team accept prooph message contracts, or must they be isolated behind an internal bus abstraction?
  • Is the repository provenance confirmed, given the “unknown” repository metadata?

Integration Approach

Stack fit
Use prooph/service-bus as an internal domain/application bus inside a Laravel modular monolith, not as a replacement for Laravel’s HTTP kernel, queue system, or broad event infrastructure. Bind command, query, and event buses in a Laravel service provider; implement a Laravel-container-aware handler locator; register middleware for validation, auth, transactions, logging, and metrics. Keep an internal bus interface so domain code does not depend directly on prooph contracts.

Migration path
Start with one bounded context or one vertical slice, preferably a non-critical command/query path. Keep Laravel’s native bus for simple jobs and framework events. Introduce prooph behind an adapter, prove handler dispatch, middleware, and transaction behavior, then expand only where explicit CQRS boundaries add value. For async needs, add an outbox and Laravel queue transport rather than adopting distributed messaging prematurely.

Compatibility
Run a compatibility spike before commitment: install against target Laravel/PHP versions, verify PSR/container compatibility, run composer why-not, and test PHP 8.1+ behavior. Confirm message serialization, middleware interfaces, and dependency constraints. If upstream is incompatible, options are pinning older Laravel/PHP, isolating usage, or maintaining a small fork; each has a TPM-visible cost.

Sequencing

  1. Prove repository provenance, license, and Composer install on target stack.
  2. Build a service-provider wrapper and container-aware handler locator.
  3. Configure middleware order: validation, auth, transaction, logging, metrics.
  4. Deliver one command and one query through the bus in a bounded context.
  5. Add event dispatch and async/outbox only if required.
  6. Document failure handling, rollback, and ownership.
  7. Decide expand, contain, or replace based on POC results.

Operational Impact

Maintenance
Moderate-to-high ownership burden because the last release is 2021. TPM should assign an explicit maintainer, monitor Composer audits and PHP/Laravel upgrades, and budget for a fork/patch path. Do not assume upstream will provide timely fixes.

Support
Community support is limited compared with Laravel-native buses. Documentation exists, but Laravel-specific examples and hiring signals are thinner. The team must understand CQRS, middleware pipelines, and message contracts; otherwise support load shifts to one or two senior engineers.

Scaling
Synchronous in-process dispatch scales with the Laravel app and is straightforward. Asynchronous scaling requires queue workers, retry policies, dead-letter queues, idempotent handlers, and monitoring of queue depth and latency. Event fan-out and long-running handlers need backpressure and operational dashboards. The package does not remove distributed-system complexity.

Failure modes
Watch for handler-not-found errors, middleware misordering, transaction rollback not propagating, message serialization/version mismatches, duplicate delivery after retries, dead-letter accumulation, circular event dispatch, and memory growth from large payloads. Async integration introduces partial-failure and observability gaps unless an outbox and trace IDs are added.

Ramp-up
Expect moderate-to-high ramp-up for a Laravel team new to CQRS and prooph: roughly one to two sprints for a safe POC plus documentation. Experienced DDD teams can move faster. TPM recommendation: conditional go for a bounded CQRS use case with an internal adapter and explicit maintenance owner; avoid for simple CRUD, latency-critical greenfield work, or teams needing long-term vendor-backed support.

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.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log