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

Domain Laravel Package

somnambulist/domain

Domain-driven design building blocks for Laravel and PHP: UUIDs, value objects, entities, aggregates, domain events, commands and repositories. A clean, framework-friendly foundation for modelling business logic with clear boundaries.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. somnambulist/domain is a set of framework-agnostic DDD primitives rather than a Laravel package: abstract entities, aggregate roots, identity/UUID handling, value-object helpers, and domain-event plumbing. That makes it a reasonable fit for a Laravel codebase that is deliberately moving toward a domain layer above Eloquent (hexagonal-ish, bounded contexts). It is a poor fit if the team wants drop-in Laravel ergonomics — there is no service provider, no facade, and no opinion about Eloquent, so wiring is manual. The value proposition is consistency of building blocks (identity, event recording) across a team, not framework integration.

Integration feasibility. Composer-installable with a small dependency surface (likely ramsey/uuid and PHP ^8.x). Because the API is primitives-level, adoption can be incremental and local to one bounded context. Two practical gaps to verify in a spike: (1) how aggregate-recorded domain events are released and bridged into Laravel's event dispatcher, and (2) whether any persistence mapping helpers exist for Eloquent or whether you write mappers/casts yourself. MIT license removes legal friction and permits forking.

Technical risk. This is the weakest dimension. 26 stars, zero dependents, and a composite score of 0.19 indicate an unproven package with essentially no production reference base. The realistic risks are: single-maintainer bus factor; silent API churn across majors; breakage on PHP or ramsey/uuid upgrades; and no community answer pool when something behaves unexpectedly. The opportunity signal (10.89) is interesting but is not evidence of fitness — it reads as "undervalued primitives," not "battle-tested library." Treat this as a vendored utility or an internal pattern library, not a load-bearing dependency.

Key questions.

  • Which PHP versions and Laravel versions are actually supported and CI-tested?
  • Exact dependency tree and transitive version constraints.
  • How are domain events recorded, released, and dispatched — and is there a documented Laravel bridge?
  • Are there Eloquent casts or mapping helpers for value objects and identities?
  • What is the test coverage and release cadence? Any changelog discipline?
  • Is the identity strategy (UUID vs ULID vs auto-increment) compatible with existing schema and index design?
  • What happens to value objects crossing queue boundaries — serialization contract?

Integration Approach

Stack fit. Best fit is a Laravel monolith that already has (or wants) an explicit domain layer: value objects for typed IDs and money/quantity, aggregate roots enforcing invariants, domain events for side effects. Eloquent remains the persistence mechanism; the package supplies the in-memory domain model. If the architecture is thin CRUD controllers over Eloquent, this package adds ceremony without payoff.

Migration path. Do not adopt wholesale. Start with the lowest-risk primitives — identity/UUID base classes and one or two value objects — in a single bounded context, and keep Eloquent models as-is. Add aggregate roots and domain-event recording only where a real invariant or cross-aggregate side effect exists. This keeps the blast radius to one module and gives a concrete go/no-go before broader commitment.

Compatibility. Verify PHP constraint against the runtime version and check whether the package's minimum PHP is stricter than Laravel's. Since there is no Laravel integration layer, compatibility is "works if the language level works." Budget for an internal adapter (event dispatcher bridge, exception-to-HTTP mapping) rather than assuming one exists.

Sequencing.

  1. Timeboxed spike (1–2 days): install, define one value object and one aggregate with a recorded event, dispatch it through Laravel's bus, persist and rehydrate via an Eloquent mapper.
  2. Decision gate: if the event bridge or persistence mapping requires substantial custom code, evaluate writing a thin in-house base class instead — the surface area is small enough that forking or reimplementing is viable.
  3. Pilot in one bounded context with tests around event release and rehydration.
  4. Establish internal conventions (naming, identity strategy, event naming) before a second team adopts it.
  5. Promote broadly only after the pilot survives a framework/PHP upgrade cycle.

Operational Impact

Maintenance. Low ongoing effort if the team uses a narrow slice, but the maintenance burden shifts to you: you own upgrade compatibility with PHP and ramsey/uuid, and you own any bug you hit. The small API surface makes pinning and patching practical. Forking under MIT is a realistic fallback and should be pre-agreed, not discovered during an incident.

Support. Effectively self-support. No dependents means no community troubleshooting corpus, no Stack Overflow answers, no third-party blog posts. Onboarding documentation must be internal. This is acceptable for a senior team and a poor choice for a team that leans on ecosystem support.

Scaling. The library itself is not a scaling concern — it is in-memory object modeling. Scaling risk is organizational: as more contexts adopt it, internal conventions (identity format, event naming, serialization) must be governed or you get divergent dialects. Establish a lightweight internal standard early.

Failure modes. Highest-probability failures: (1) domain events recorded on aggregates but never released, causing silently missing side effects; (2) value objects failing around queue serialization or Eloquent hydration; (3) a PHP or dependency upgrade breaking the package with no upstream patched release; (4) developers new to DDD misusing aggregate roots as anemic wrappers, generating complexity with no invariant enforcement. Each has a cheap mitigation: an integration test asserting event dispatch, an explicit serialization contract, a version pin with a documented fork procedure, and a short design-review checklist.

Ramp-up. The API is small; the real ramp-up cost is DDD fluency, not the package. Expect a few days for a senior developer to be productive and a short internal guide for the rest of the team. If the team lacks DDD experience, the package's abstractions will feel like overhead before they feel like leverage — sequence the pilot accordingly.

TPM recommendation. Proceed as a scoped spike, not a platform commitment. The architecture is aligned with a DDD-leaning Laravel codebase, but adoption signals are too weak to justify broad dependency. Approve the 1–2 day evaluation with an explicit fork-or-reimplement exit criterion, and gate wider rollout on the pilot surviving one upgrade cycle and one queue-based event flow.

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.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core