- Does prooph/service-bus work with Laravel?
- It can be installed via Composer and wired through a Laravel service provider, but there is no first-party Laravel integration. You must implement Laravel-container-aware handler resolution and configure middleware yourself. It fits best when the application already values explicit CQRS message boundaries, handler isolation, and middleware pipelines.
- How do I install prooph/service-bus in a Laravel application?
- Install it with Composer, register a service provider to build command, query, and event buses, bind a container-aware handler locator, and register middleware. Run a dependency spike against your target Laravel and PHP versions because the last upstream release was 2021-08-25. Confirm PSR-11 compatibility and message contracts before expanding usage.
- Is prooph/service-bus compatible with Laravel 10 or 11 and PHP 8.2+?
- Compatibility is not guaranteed by upstream, and modern Laravel and PHP support must be proven with a dependency spike. Use composer why-not and a test suite against your target versions to verify the dependency graph and runtime behavior. If constraints block installation, options include pinning older versions, isolating usage, or maintaining a small fork under BSD-3-Clause.
- What is the difference between prooph/service-bus and Laravel's native command bus?
- Laravel provides its own command bus, events, and queue abstractions for typical application workflows. prooph/service-bus is framework-agnostic and focuses on explicit CQRS message boundaries, middleware pipelines, and handler resolution. In a conventional Laravel CRUD app it duplicates native features and adds conceptual overhead, but it can fit a DDD-oriented modular monolith.
- How does handler resolution work in prooph/service-bus?
- The bus routes each message to a handler through a handler locator or resolver. In Laravel you typically implement a container-aware locator that resolves handler services from the Laravel container. You also need to adapt message factories and keep handler registration consistent across command, query, and event buses.
- Can prooph/service-bus handle asynchronous commands with Laravel queues?
- It is synchronous by default, so asynchronous execution requires bridging to Laravel queues, Symfony Messenger, Enqueue, or a custom transport. You must design idempotency, retries, dead-letter handling, message serialization and versioning, and transaction semantics once messages cross process boundaries. Avoid adopting distributed messaging prematurely unless durable async execution is a real requirement.
- How should I order middleware in prooph/service-bus?
- A practical order is validation, authorization, transaction boundary, then logging and metrics, with careful attention to whether logging wraps or sits inside transactions. Middleware ordering affects failure behavior and transaction semantics, so document and test the pipeline explicitly. Revisit the order when asynchronous transports are introduced.
- How do I test prooph/service-bus integration in Laravel?
- Build a compatibility and integration spike before commitment, then test handler dispatch, middleware order, transaction behavior, and message serialization. Keep an internal bus adapter so domain code does not depend directly on prooph contracts, and unit test that adapter separately. Add integration tests for the Laravel service provider and container-aware handler locator.
- Is prooph/service-bus actively maintained?
- The last release was 2021-08-25, and the prooph ecosystem has limited recent activity. That creates upgrade, security patching, and talent-pool risk for production use. BSD-3-Clause is permissive and helps if you need to fork or patch internally, but assign clear ownership for maintenance.
- What alternatives exist to prooph/service-bus for CQRS in Laravel?
- Alternatives include Laravel's native command bus and events, Symfony Messenger, Tactician, or a custom internal bus abstraction. For many Laravel applications, native abstractions plus a service layer are sufficient. Choose prooph only when explicit message boundaries and middleware pipelines justify the integration and maintenance cost.