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

Ddd Extensions Laravel Package

fusonic/ddd-extensions

A lightweight PHP package of Domain-Driven Design building blocks, offering reusable base classes and extensions for entities, value objects, aggregates, and domain events. Helps keep Laravel and plain PHP projects structured around explicit domain models.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package is explicitly aimed at Symfony + Doctrine ORM. That is the opposite end of the PHP framework spectrum from a Laravel application, which is Eloquent-first. The DDD primitives it advertises — aggregate roots, entities, value objects, identities, domain events, domain exceptions — are conceptually stack-agnostic, but this library binds them to Doctrine (embeddables, custom DBAL types, likely a postFlush event subscriber) and to Symfony's event dispatcher. Adopting it wholesale in a Laravel codebase implies either running Doctrine inside Laravel or amputating the ORM layer. Neither is a decision a TPM should let a team make by accident.

Integration feasibility. Partial at best. The pure-PHP surface (interfaces, base classes, traits, exceptions) should be usable without the Symfony container, but any Doctrine-coupled code is a hard dependency on doctrine/orm. Laravel already ships symfony/event-dispatcher, so the dispatcher dependency is less of a conflict than it appears; the ORM dependency is the real blocker. Feasibility is therefore conditional on two things: (a) how much of the "building blocks" logic is actually ORM-agnostic, and (b) whether the team is willing to vendor/fork the relevant classes rather than depend on the package at runtime.

Technical risk. High, on several axes. The adoption signals are poor: 1 star, 0 dependents, and an opportunity score of 33.37. That pattern is consistent with an internal library extracted from a single Symfony application, published for convenience, and maintained opportunistically. There is no meaningful community, no ecosystem of consumers, and no evidence of an SLA. Specific risks:

  • Bus factor and abandonment. Single-vendor maintenance; no dependents to detect breakage; release cadence unknown.
  • API stability. No published compatibility promise or examples for non-Symfony consumers.
  • Coupling opacity. Without reading the source, the boundary between pure domain code and Doctrine/Symfony code is unknown — which is precisely what determines whether this is usable in Laravel.
  • Version drift. Doctrine ORM constraints and Symfony component ranges could conflict with Laravel's shipped Symfony versions or with laravel-doctrine/orm if that route is chosen.

Key questions. These need answers before any integration commitment:

  1. What is the class inventory, and how much of it has zero imports from Doctrine\* or Symfony\*?
  2. How are domain events dispatched — via Doctrine postFlush, a Symfony subscriber, or PSR-14? Is dispatch transactional?
  3. Are identifiers and value objects modeled as DBAL types, embeddables, or plain objects with explicit converters?
  4. What PHP versions and Doctrine/Symfony version ranges are supported, and what is the release history?
  5. Is there an ORM-agnostic core we can consume, or is the ORM integration inseparable?
  6. Who maintains it, and what is the realistic expectation for issue response?

Verdict. Do not adopt as a runtime dependency for a Laravel application. Evaluate it as a reference implementation and a source of small, battle-tested patterns that can be vendored into the domain layer. The DDD primitives are worth ~100–300 lines of in-house code; the package's real value is in showing what those lines look like, not in being installed.

Integration Approach

Stack fit. Laravel's event pipeline (events, listeners, queued listeners, DB::afterCommit) is a different model from Symfony's dispatcher and Doctrine's postFlush hook. Domain events recorded on an aggregate and released on flush are a Doctrine-shaped pattern; in Laravel/Eloquent the equivalent idiom is model observers plus DB::afterCommit, or an explicit releaseEvents() call at the transaction boundary of an application service. The package's event mechanics will not port cleanly, and attempting to shoehorn them will produce two competing event systems.

Migration path. Two viable routes, in order of preference:

  • Route A — Vendor the pure domain layer. Copy the ORM-agnostic classes (aggregate root, domain event, identity, value object, domain exception) into app/Domain/Support/ or a small internal package, re-namespaced under your own vendor, with attribution. Wire domain-event release to Laravel's dispatcher at your service-layer boundary. This preserves the concepts, removes the external dependency, and keeps the ORM out of the domain.
  • Route B — Use Doctrine in Laravel. Only justifiable if the team has an existing Doctrine commitment. Install laravel-doctrine/orm, register the package's subscriber and DBAL types, and accept the operational overhead of two persistence paradigms. This is the only route where the package is used as designed, and the only route where the Symfony/Doctrine coupling is an asset rather than a liability. It is almost never the right call for a greenfield Laravel product.

Compatibility. Pin and verify: PHP version against your runtime; doctrine/orm major version against any existing Doctrine usage; symfony/event-dispatcher range against Laravel's shipped version (Laravel tracks Symfony closely, but majors can diverge). Run composer why-not against the candidate version set before prototyping. License is MIT, which permits forking and internal redistribution — confirm attribution expectations with legal, but there is no copyleft exposure.

Sequencing.

  1. Source review (1–2 days). Class inventory; classify each class as pure, Symfony-coupled, or Doctrine-coupled; read the tests to infer intended usage and transactional semantics.
  2. Architecture decision (explicit, recorded). Eloquent + vendored domain layer vs. Doctrine in Laravel. This is a TPM decision, not an engineer's incidental choice.
  3. Spike (≤1 week). Implement one real bounded context's aggregate with the chosen pattern; release domain events through Laravel's dispatcher inside a transaction; write tests for rollback behaviour.
  4. Convention document. Define where aggregates live, when events are released, how IDs are represented (UUID/ULID), and how value objects map to Eloquent casts.
  5. Bounded-context rollout. Adopt context by context; do not attempt a sweeping refactor.
  6. Fork governance. If Route A is taken, name an internal owner and a review cadence for the vendored code.

Recommendation. Route A. Treat the package as documentation, not infrastructure.

Operational Impact

Maintenance. Under Route A the ongoing cost is one internal owner and periodic review of a small, stable set of classes — low and predictable. Under Route B the cost is Doctrine operational literacy plus two persistence stacks — materially higher. Under a direct runtime dependency the cost includes tracking upstream releases that may never come; a package with 0 dependents and negligible stars should be assumed to have an undefined maintenance horizon.

Support. There is no commercial support, no SLA, and no meaningful issue history to infer responsiveness. Internal ownership is therefore mandatory regardless of route. Documentation will need to be written, not consumed. Budget for that explicitly.

Scaling. The package itself is thin; runtime overhead is negligible. The scaling risk is architectural: Doctrine's identity map and unit-of-work flush semantics behave differently from Eloquent's immediate saves, and mixing them — or adopting Doctrine's model in a Laravel app — introduces memory growth, flush-ordering surprises, and N+1 patterns that are unfamiliar to most Laravel engineers. Keep the domain layer free of ORM concerns and scaling is a non-issue.

Failure modes to instrument and test.

  • Domain events lost on transaction rollback, or dispatched twice when an aggregate is persisted more than once.
  • Events released before commit, causing downstream listeners to act on data that is later rolled back.
  • Events fired during seeding, fixtures, or queue workers without intended side effects.
  • Null/immutability handling in value objects mapped as embeddables or casts.
  • Custom DBAL type conversion errors surfacing during migrations rather than at write time (Route B).
  • Cross-context event leakage where one bounded context's internal events are consumed as if they were integration events.
  • Vendor drift: a fork that diverges silently from upstream, or a pinned package that blocks a PHP or Symfony upgrade.

Ramp-up. The team needs DDD literacy (aggregates, invariants, domain vs. integration events, transaction boundaries) more than package-specific knowledge. Doctrine familiarity is needed only under Route B. A realistic ramp is one sprint for the spike plus convention-setting, with the first production bounded context landing in the following sprint. The package reduces that effort marginally; the architecture decisions and conventions carry the real weight.

Bottom line. Low operational value as a dependency, moderate value as a pattern reference. The 1-star, 0-dependent, low-opportunity profile should be read as "not a platform bet." Recommend a short spike to extract the ideas, an explicit build-not-buy decision, and no runtime coupling to the package.

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.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin