Skip to content
CAI
Software that uses CAICheck a score

jaspertey/laravel-ddd

61.2

Adequate · 9 November 2026

4.8k

lines of production code

PHP

primary language

10

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Laravel package that facilitates Domain-Driven Design by providing a structured way to organize and manage domain-specific code. It offers a suite of Artisan commands to generate domain objects like models, actions, and factories, while automatically discovering and registering these components within the application. The package also handles configuration management, namespace resolution, and ensures consistency between the codebase and the database schema.

How it got here

2023 — Rebranding and DDD architecture expansion

14 changes.

The project was rebranded from Lunarstorm to Tey, updating namespaces and dependencies while upgrading to PHPUnit 12 and supporting Laravel 11-13. Significant architectural enhancements were introduced, including a refactored configuration schema, automatic domain autoload discovery, and new domain-aware code generators and model traits.

2024 — v4 rebuild and test coverage

9 changes.

This period focused on the v4 rebuild of the Laravel DDD package, introducing new facades, enums, and diagnostic routes while updating code generation stubs to align with the new architecture. Significant effort was dedicated to establishing comprehensive test coverage for the autoload manager, command utilities, code generator, and configuration management to ensure reliability and correctness.

2025–2026 — test coverage and documentation

8 changes.

This period focused on expanding test coverage for domain migration pruning, command lifecycles, and framework compatibility, alongside adding frozen consumer comparison tests to ensure behavioral stability. It also introduced new documentation and development guidelines for the Laravel-DDD package, along with a configuration exception to improve user experience.

Features

Added Laravel Boost guidelines and development skill for Laravel-DDD

New documentation and a development skill have been added to guide users on using the \tey/laravel-ddd\ package. The \core.blade.php\ guidelines instruct developers to inspect \config/ddd.php\ and Composer mappings before placing domain objects, while the \laravel-ddd-development\ skill provides detailed instructions on generating objects, customizing generation via stubs, and managing discovery and caching behaviors specific to the package's configuration.

resources · high confidence

Added testing routes and LayerType enum for Tey\\LaravelDDD

The package now includes a new \routes/testing.php\ file that registers diagnostic endpoints under the \laravel-ddd\ prefix (home, config, autoload) to inspect registered providers and commands via the \Tey\\LaravelDDD\\Facades\\Autoload\ facade. Additionally, a new \Tey\\LaravelDDD\\Enums\\LayerType\ enum was introduced with cases for Domain, Application, and Custom layers, supporting the package's internal structure.

routes, src/Enums · high confidence

Introduces domain-aware factory resolution for Laravel models

This change adds two new classes to the \src/Factories\ directory: \DomainFactory\ and the \HasDomainFactory\ trait. \DomainFactory\ extends Laravel's base \Factory\ and implements a \resolveFactoryName\ method that prioritizes finding factory classes within the application's domain layer before falling back to the standard \/database/factories\ directory. The \HasDomainFactory\ trait provides a drop-in replacement for Laravel's standard \HasFactory\ trait; when applied to a model, it automatically delegates factory instantiation to \DomainFactory\, ensuring that model factories are resolved according to the configured domain structure.

src/Factories · high confidence

Introduction of abstract DomainModel base class

A new abstract \DomainModel\ class has been added to the \Tey\\LaravelDDD\\Models\ namespace, extending Laravel's \Illuminate\\Database\\Eloquent\\Model\. This class serves as a base for domain models by automatically including the \HasDomainFactory\ trait and setting all attributes as fillable (guarded = \[\]).

src/Models · high confidence

New Facades for Autoload and Domain Management

Added \Tey\\LaravelDDD\\Facades\\Autoload\ and \Tey\\LaravelDDD\\Facades\\DDD\ to provide static access to the \AutoloadManager\ and \DomainManager\ respectively. The \Autoload\ facade exposes methods for booting, running, and retrieving paths and registered commands, providers, listeners, and subscribers. The \DDD\ facade provides access to autoloader configuration, object schema resolution, package paths, and managers for config, stubs, and composer operations.

src/Facades · high confidence

New domain autoload and discovery support classes

The package now includes a suite of support classes in src/Support to manage domain-driven development workflows. AutoloadManager handles the bootstrapping and registration of domain providers, commands, policies, factories, and event listeners, utilizing DomainCache to store and retrieve discovery manifests and recover stale data. DomainDiscovery performs the actual scanning of directories for these classes, including logic to filter listeners and subscribers. DomainResolver and Domain classes manage namespace resolution, path mapping, and layer identification (Domain vs. Application). DomainMigration handles the discovery and caching of migration paths, while GeneratorBlueprint provides the schema and context for code generation commands. These classes collectively enable automatic discovery and registration of domain components within the Laravel application.

src/Support · high confidence

New domain structure value objects for namespace and path resolution

The library introduces a new set of value objects in the \Tey\\LaravelDDD\\ValueObjects\ namespace to manage domain metadata. \DomainNamespaces\ aggregates the configured namespace strings for all domain components (models, commands, events, etc.) based on a domain and optional subdomain. \DomainObject\ and \DomainObjectNamespace\ provide utilities to resolve fully qualified class names into structured domain metadata, including names, namespaces, and file paths, while \CommandContext\ offers a typed way to access command arguments and options. These objects form the foundation for consistent domain structure resolution within the package.

src/ValueObjects · high confidence

Behavioural changes

Automatic pruning of domain migrations and cache clearing on schema dump

When running \schema:dump --prune\, the package now automatically deletes the directories containing domain-specific migrations and triggers a cache clear. This ensures that stale domain migration files are removed from the filesystem and the application cache is refreshed, keeping the database schema state consistent with the pruned definition.

src/Listeners · high confidence

DDD configuration schema refactored with new layer and autoloading options

The \config/ddd.php\ file has been significantly restructured to support a more granular Domain-Driven Design setup. The previous flat \paths\ array is replaced by distinct \domain\_path\/\domain\_namespace\ and \application\_path\/\application\_namespace\ keys, and the default domain path key has changed from \domains\ to \domain\. A new \layers\ configuration allows defining custom top-level namespaces (e.g., Infrastructure). The \namespaces\ array now includes many more object types (such as actions, value objects, casts, and channels) and uses singular keys. New configuration options have been added for base classes (\base\_model\, \base\_dto\, \base\_view\_model\, \base\_action\) and a new \autoload\ section controls the discovery of providers, commands, policies, factories, migrations, and listeners. Additionally, an \autoload\_ignore\ key allows excluding folders from PSR-4 class scanning.

config · high confidence

Namespace rebrand to Tey\\LaravelDDD

The database factory namespace has been updated from Lunarstorm\\LaravelDDD\\Database\\Factories to Tey\\LaravelDDD\\Database\\Factories. This change reflects the package rebranding and requires updating any code that references the old namespace to ensure proper autoloading and functionality.

database · high confidence

Rebrand to Tey\\LaravelDDD with expanded generators and config safety

The package has been rebranded from Lunarstorm\\LaravelDDD to Tey\\LaravelDDD, introducing a comprehensive suite of new domain-specific Artisan commands (such as ddd:action, ddd:factory, and various domain model/entity generators) alongside a new ComposerManager for handling autoload registration. Configuration handling has been significantly improved to safely resolve symlinked config files and merge package defaults without discarding user-defined values, while the StubManager now dynamically includes Laravel's framework stubs to support a wider range of generated classes.

src · high confidence

Rebranded to Tey\\LaravelDDD with new domain-aware generator commands

The package has been rebranded to \tey/laravel-ddd\ with the \Tey\\LaravelDDD\ namespace, replacing the previous \ddd:\*\ command structure with a comprehensive set of domain-specific generators (e.g., \ddd:controller\, \ddd:model\, \ddd:action\). These commands now support nested domain paths (e.g., \Billing/Invoice\) and automatically forward child generation requests to ensure correct file placement and import resolution. The update also introduces a new \ddd:config\ command for managing DDD configuration and layers, and adds support for Laravel 12 and 13.

src/Commands · high confidence

Updated code generation stubs for Laravel DDD components

The package's code generation stubs have been updated to align with the v3 rebrand and v4 rebuild fixes. The base model stub now uses the Tey\\LaravelDDD namespace and includes the HasDomainFactory trait, while the factory stub has been moved and refactored to extend Illuminate\\Database\\Eloquent\\Factories\\Factory instead of the previous BaseModel structure. The DTO stub no longer extends Spatie\\LaravelData\\Data, and a new base view-model stub has been added to support reflection-based array conversion. Additionally, the value-object stub has been renamed from the previous DTO stub, and a new action stub has been introduced to support the Lorisleiva\\Actions package.

stubs · high confidence

Upgrade to PHPUnit 12 and rebrand to tey/laravel-ddd

The package has been rebranded from lunarstorm/laravel-ddd to tey/laravel-ddd, with the root PHP namespace updated from Lunarstorm\\LaravelDDD to Tey\\LaravelDDD. The test suite has been upgraded to PHPUnit 12, which updates the XML schema location, changes the cache directory to .phpunit.cache, and renames the test suite. Additionally, PHPStan configuration has been adjusted to treat PHPDoc types as uncertain to resolve static analysis failures with newer Laravel versions, and the .gitignore file now excludes the new PHPUnit cache directory.

(repo-wide) · high confidence

Fixes

Added EmptyRootNamespace exception for invalid configuration

A new EmptyRootNamespace exception class has been added to the src/Exceptions directory. This exception is thrown when the DDD configuration keys for domain or module namespaces are left empty, providing a clear error message that suggests valid namespace formats (e.g., 'Domain' or 'App\\Modules') to help users correct their configuration.

src/Exceptions · high confidence

Test coverage

Added comprehensive test coverage for DDD command utilities; Added comprehensive test coverage for the AutoloadManager; Added comprehensive test coverage for the DDD code generator; Added framework compatibility contract tests; Added frozen consumer comparison tests; Added skeleton test fixtures for DDD layer validation; Added test coverage for the Support layer internals; Added test datasets for domain object generation and configuration; Added test fixture for command lifecycle verification; Added test fixture for partial subscriber compatibility; Added test fixtures for event handling scenarios; Added test for config file publishing; Added test suite for domain model factory resolution and configuration; Added tests for config merging and persistence safety; Added tests for domain migration pruning.

Dependencies

Package rebranded to Tey\\LaravelDDD with major dependency and framework upgrades

The package has been rebranded from Lunarstorm\\LaravelDDD to Tey\\LaravelDDD, updating the namespace, author, and homepage. This release upgrades the minimum PHP version to 8.3 and adds support for Laravel 11, 12, and 13 (via illuminate/contracts ^11.44\|^12.0\|^13.0). Several dependencies have been updated or added: Pest testing framework moved to v4, larastan to v3, collision to v8, and orchestra/testbench to v9.11/v10/v11. New dependencies include laravel/prompts, lorisleiva/lody, symfony/finder, and symfony/var-exporter. Suggested packages for Data Transfer Objects and Actions have been added. The service provider and facade aliases have been updated to reflect the new namespace.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 61 → 61 (+0.6)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 54 → 54 (+0.0)
  • Architecture 98 → 98 (-0.1)
  • Maturity 58 → 62 (+4.4)
  • Readiness 89 → 89 (+0.0)
  • Security 56 → 56 (+0.0)
  • Domain Modelling 100 → 100 (+0.0)

Findings

  • No change — the same findings as the prior survey.

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

jaspertey/laravel-ddd was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 9 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 09317395e99b79eb950dfd7a8efc46fab0f9b8d4 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.4+preprod-464a0040a931.