- What is onliner/laravel-command-bus used for?
- It is a lightweight Laravel integration for a command bus that maps commands to dedicated handlers and supports middleware pipelines. It helps keep write operations cleanly separated from controllers and models by dispatching them as command objects. The package also includes AMQP-related transport and logging concerns for services using a broker.
- How do I install onliner/laravel-command-bus in a Laravel application?
- Install it with Composer using composer require onliner/laravel-command-bus, then wire the package service provider and configuration into your Laravel app. Confirm the exact provider and config steps against the package README and release notes for your version. Start in a non-production service and verify Composer constraints against your Laravel and PHP runtime.
- Does onliner/laravel-command-bus require an AMQP broker?
- The evaluation indicates the package includes AMQP-related transport and logging concerns, so it is best suited to Laravel services already using an AMQP broker. If you only need in-process command-to-handler dispatch, confirm whether AMQP is optional in your configuration. Validate broker connectivity, routing, and credentials in staging before production use.
- How are commands mapped to handlers in this Laravel command bus?
- The package follows the command bus pattern: you create a command object and a dedicated handler, then dispatch the command through the bus. The bus routes the command to its handler and runs any configured middleware pipeline around it. Confirm the exact naming and registration conventions in the package documentation for your version.
- Can I add middleware to the command bus pipeline?
- Yes, the package supports middleware pipelines around command handling. This lets you add cross-cutting behavior such as logging, validation, transactions, or authorization without putting it in every handler. Review middleware ordering and error handling in staging because exceptions can affect retry and logging behavior.
- Which Laravel and PHP versions are supported by onliner/laravel-command-bus?
- The available evaluation does not provide a clear support matrix, so you should verify Composer constraints against your target Laravel and PHP runtime. Check the package composer.json, release history, and issue tracker before adoption. Also confirm compatibility with your existing AMQP client or library versions.
- What does the v1.1.8 debug option do?
- v1.1.8 is a low-risk patch that adds a debug option for AMQP logging, improving diagnosability during integration and incident triage. It does not appear to introduce a breaking API change or mandatory new infrastructure. Confirm whether the option is environment-driven and off by default before using it.
- Is it safe to leave AMQP debug logging enabled in production?
- Generally no; debug logging should be used only in lower environments or behind an explicit production-safe flag. Leaving it on can increase log volume, I/O, and disk pressure, and debug entries may include sensitive payloads depending on the implementation. Define production logging defaults and rollback steps before rollout.
- How should I test a Laravel command bus integration with AMQP?
- Treat it as a pilot integration: install in a non-production service, wire the provider and config, and exercise representative commands through a staging AMQP broker. Enable debug logging in staging to validate routing, publishing, and consumption, then test retries, failures, and duplicate handling. Review log volume and operational behavior before expanding to production.
- Is onliner/laravel-command-bus actively maintained and suitable for production?
- The evaluation notes a low change surface for v1.1.8, but ongoing maintenance depends on package activity and maintainer responsiveness. Community or GitHub-based support likely requires internal ownership, so pin versions and establish a runbook for AMQP failures and logging toggles. For alternatives, compare Laravel native queues and jobs, Horizon, and other command bus packages based on your AMQP needs.