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

Doctrine Orm Bridge Laravel Package

simple-bus/doctrine-orm-bridge

Doctrine ORM bridge for SimpleBus/MessageBus. Provides command bus middleware to run command handling inside Doctrine transactions and to dispatch domain events generated by entities. Part of the SimpleBus ecosystem.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Event-Driven Architecture (EDA) Adoption: Enables seamless integration of domain events with Doctrine ORM, accelerating migration to CQRS or event sourcing patterns without custom infrastructure. Ideal for teams prioritizing decoupled services or reactive workflows.
  • Transaction Safety for Commands: Eliminates boilerplate for wrapping commands in transactions, reducing data inconsistency risks in critical workflows (e.g., payments, inventory). Supports atomic command execution out-of-the-box.
  • Build vs. Buy Decision: Avoids reinventing transactional event middleware, saving 3–6 months of dev time for teams already using SimpleBus/Doctrine ORM. Justifies investment for projects with high persistence complexity.
  • Key Use Cases:
    • Domain-Driven Design (DDD): Automates event handling for aggregates (e.g., Order entities emitting OrderCreatedEvent).
    • Audit/Compliance: Captures entity changes (e.g., PreUpdate events) for immutable logs without manual tracking.
    • Asynchronous Side Effects: Decouples commands from notifications/analytics (e.g., UserRegisteredEventSendWelcomeEmail).
    • Legacy Modernization: Gradually introduces event-driven patterns into monoliths using Doctrine ORM.

When to Consider This Package

  • Adopt When:

    • Your stack includes Doctrine ORM + SimpleBus MessageBus (or you’re willing to adopt both).
    • You need atomic command execution (e.g., commands that must fail entirely if the database transaction fails).
    • Domain events are core to your architecture (e.g., CQRS projections, real-time updates).
    • You want to reduce transactional boilerplate (e.g., no manual flush()/commit() calls in handlers).
    • Your team values testability and separation of concerns (events decoupled from command logic).
  • Look Elsewhere If:

    • You’re not using Doctrine ORM (e.g., Eloquent, raw SQL, or another ORM like Propel).
    • Your event bus is not SimpleBus-compatible (e.g., Symfony Messenger, RabbitMQ, or custom solutions).
    • You need advanced event sourcing (e.g., storing events in a dedicated table; this package focuses on in-memory event collection).
    • Your use case requires real-time event streaming (e.g., WebSockets, Kafka); this package is optimized for synchronous/transactional workflows.
    • You’re constrained by license incompatibilities (MIT is permissive, but audit downstream dependencies).

How to Pitch It (Stakeholders)

For Executives:

*"This package lets us safely adopt event-driven architecture without custom infrastructure. By integrating SimpleBus with Doctrine ORM, we can:

  • Automate transactional workflows: Commands and events are handled atomically, cutting bugs from manual transaction management.
  • Decouple services: Domain events (e.g., OrderShipped) trigger side effects (e.g., notifications, analytics) without tight coupling.
  • Accelerate development: Replace weeks of custom middleware work with a battle-tested, MIT-licensed solution. Example: For our new subscription management feature, this ensures notifications fire reliably—even if the database rolls back. It’s a drop-in for Doctrine/SimpleBus apps and could save us 2–3 sprints of dev time."*

For Engineers:

*"This is a zero-dependency bridge that:

  1. Wraps commands in transactions: No more forgetting to flush()—the middleware handles it.
  2. Automates event collection: Domain events (e.g., UserRegisteredEvent) are captured and dispatched without manual loops.
  3. Recovers from failures: If a transaction fails, the EntityManager resets cleanly (post-3.0.0). Use it for:
  • CQRS projections (e.g., read models updated via events).
  • Audit trails (events stored in a log table).
  • Decoupled services (e.g., a ProcessPayment command triggers a PaymentProcessedEvent). Trade-offs: Tied to SimpleBus/Doctrine; not a silver bullet for async event sourcing. But for synchronous, transactional event handling, it’s a no-brainer."*

Call to Action: "Let’s prototype this for [high-priority feature X]. It’s a drop-in for SimpleBus/Doctrine apps and could save us [Y] hours of dev time. Start with a spike to validate integration with our existing command/event patterns."

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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky