Weave Code
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

Cqrs Php Laravel Package

black/cqrs-php

Minimal CQRS command bus for PHP/DDD without event sourcing. Define Command and CommandHandler, register handlers to commands, then dispatch via a single Bus. Includes optional Symfony bundle integration with service tags for handler registration.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Adoption of Domain-Driven Design (DDD) patterns in PHP-based systems, particularly for teams prioritizing separation of concerns, bounded contexts, and explicit command/query segregation.
  • Microservices or modular monoliths where CQRS simplifies scaling read/write operations independently (e.g., high-traffic APIs with complex business logic).
  • Roadmap for decoupling business logic from persistence layers, enabling easier testing, maintenance, and future-proofing of architecture.
  • Build vs. Buy: Justifies buying this lightweight package over building a custom CQRS implementation if the team lacks DDD expertise or needs a quick, opinionated starting point.
  • Use Cases:
    • E-commerce platforms (e.g., order processing vs. inventory queries).
    • SaaS applications with heavy transactional workloads (e.g., user subscriptions, analytics).
    • Legacy systems requiring gradual DDD adoption without full rewrite.

When to Consider This Package

  • Avoid if:
    • Your team lacks DDD/CQRS familiarity (steep learning curve for command/query separation).
    • You need Event Sourcing (this package explicitly excludes it).
    • Your project requires advanced event handling (e.g., sagas, event versioning).
    • You’re using non-Symfony frameworks (SymfonyBundle integration is limited; vanilla PHP usage is minimal).
    • Performance is critical: The package’s simplicity may not optimize for high-throughput systems (e.g., real-time bidding).
  • Look elsewhere if:
    • You need query-side optimizations (e.g., GraphQL, read models) beyond basic command handling.
    • Your stack is non-PHP (e.g., Node.js, Go) or uses alternative PHP frameworks (Laravel’s built-in service containers may conflict).
    • You require enterprise-grade CQRS (e.g., Axoniq CQRS for Java/Kotlin).

How to Pitch It (Stakeholders)

For Executives: "This MIT-licensed package lets us adopt Command Query Responsibility Segregation (CQRS)—a battle-tested pattern for scaling complex PHP applications—without reinventing the wheel. By separating read/write operations, we can optimize performance, simplify maintenance, and future-proof our architecture for modular growth. It’s a lightweight, Symfony-compatible solution that aligns with DDD principles, reducing technical debt while keeping costs low."

For Engineers: *"This package provides a minimalist CQRS bus for PHP, perfect for teams already using DDD. Key benefits:

  • No Event Sourcing overhead: Pure CQRS for command handling.
  • Symfony integration: Works seamlessly with dependency injection (via black_cqrs.handler tag).
  • Laravel-friendly: Can be adapted via service containers (though not natively supported).
  • Inspired by Doctrine/LiteCQRS: Proven design patterns from the PHP ecosystem. Tradeoff: Limited query-side features, but ideal for command-heavy workflows (e.g., payments, workflows)."*
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.
craftcms/url-validator
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony