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 Kata

Domain Kata Laravel Package

phpmentors/domain-kata

A Domain-Driven Design library for PHP offering reusable building blocks—entities, value objects, identifiers, repositories, and domain services—to help you model rich, expressive domains with clean, framework-agnostic code.

View on GitHub
Deep Wiki
Context7

Kata for domain models

Frequently asked questions about Domain Kata
What is phpmentors/domain-kata and what DDD building blocks does it provide?
It is a lightweight, framework-agnostic PHP toolkit from PHP Mentors (Japan) that supplies base classes and interfaces for entities, value objects, identities, aggregates, domain events, repositories, and specifications. Version 1.4.0 also adds UsecaseInterface, ServiceInterface, InOutInterface, IdentifiableInterface, and EntityCollectionInterface::toArray(). It is best understood as a teaching kata demonstrating DDD tactical patterns rather than an infrastructure library.
Does phpmentors/domain-kata support Laravel 10/11 and PHP 8.2?
No. The last tag, v1.4.0, was released on 2015-06-13 and targets the PHP 5.x era with a PHPUnit 4 test suite, so composer require will fail dependency resolution or fatal on language-level incompatibility on PHP 8.2 and Laravel 9 through 11. It is only realistic as a vendored or forked pattern source, not a working dependency.
How do I install phpmentors/domain-kata with Composer?
Running composer require phpmentors/domain-kata resolves to v1.4.0, the terminal release, and will not install cleanly on a modern Laravel application. The practical route is to read or vendor the source from GitHub and copy the specific abstractions you need. Note the package predates PSR-4 adoption and uses PSR-0/PSR-4-era plain PHP conventions.
Is phpmentors/domain-kata still maintained?
No. v1.4.0 is the final tag and matches the previously recorded last-release date, confirming eleven years without a subsequent release, no maintainer activity, and no security response path. Adoption signals are weak as well, with roughly 73 GitHub stars and zero dependents. Treat it as a frozen reference artifact.
Can I use phpmentors/domain-kata domain events with Laravel's event dispatcher?
The library ships a static, global DomainEventPublisher, which sits awkwardly against Laravel's container-bound dispatcher and creates testability and lifecycle hazards. You would need a bridge or adapter, and the global state makes it hard to swap or reset listeners in tests. In practice most teams record events inside aggregates and dispatch them through Laravel's native dispatcher instead.
How do entities, value objects, and aggregates work in phpmentors/domain-kata?
Entities carry identity, value objects are compared by value, and aggregates act as consistency boundaries that collect domain events. The APIs are small and explicit, which makes the model easy to reason about and unit test in isolation. Value objects are hand-rolled rather than Eloquent custom casts, so you typically map them at the persistence or API boundary.
What are good alternatives to phpmentors/domain-kata for DDD in Laravel?
For event-sourced or CQRS-heavy domains, look at spatie/laravel-event-sourcing, broadway/broadway, or prooph components. For lighter tactical DDD, many Laravel teams hand-roll value objects and custom casts and dispatch domain events via the framework dispatcher, which avoids a stale dependency entirely. There is no actively maintained package that directly mirrors this kata's scope.
Is phpmentors/domain-kata's license safe to use in a commercial project?
The license metadata reports NOASSERTION, meaning there is no clear grant, which is the highest-severity risk item in any review. Until legal counsel rules on it, treat the code as reference-only and avoid shipping it or copying snippets into production. This gate is independent of the technical abandonment issue.
How do I unit test domain logic built with phpmentors/domain-kata?
The small, explicit APIs make entities, value objects, and aggregates straightforward to instantiate and assert against in plain PHPUnit tests, with no framework bootstrapping required. The caveat is the static DomainEventPublisher, whose global state must be reset or stubbed between tests. You also cannot run the package's own PHPUnit 4 suite on modern PHP, so any tests you write will be your own.
Should I require phpmentors/domain-kata or just learn from its patterns?
Learn from it only. Depending on it means an unmaintained 2015 package with an unclear license, no PHP 8 support, and no security path. If you borrow patterns, deliberately decline InOutInterface, which extends EntityInterface and conflates a use-case DTO with an identity-bearing aggregate, and ServiceInterface, which is an empty marker with no enforcement. Copying those invites ceremonial use-case plumbing with no behavioural payoff.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource