Skip to content
CAI
Software that uses CAICheck a score

jaspertey/laravel-ddd

77.1

Strong · 22 September 2026

4.6k

lines of production code

PHP

primary language

7

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 Artisan commands to generate domain-specific code such as models, actions, and DTOs. It automates the discovery and autoloading of domain components like providers, listeners, and factories, ensuring they are correctly registered within the application. The package also manages configuration for custom domain layers and handles cache synchronization for database migrations.

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 — DDD package rebranding and test expansion

8 changes.

The project rebranded to Tey\\LaravelDDD, introducing new code generation stubs, facades, and layer enums to support Domain-Driven Design workflows. This period focused heavily on establishing comprehensive test coverage for the autoload manager, command utilities, code generator, and configuration management to ensure reliability and correct behavior.

2025–2026 — test coverage expansion and documentation

7 changes.

This period focused on significantly expanding test coverage by adding fixtures for command lifecycles, event handling, and framework compatibility, alongside frozen consumer comparison tests to ensure behavioral stability. It also involved creating new documentation and development skills to guide users on package configuration and object generation.

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

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

Rebranded to Tey\\LaravelDDD with new stubs and testing routes

The package has been rebranded to Tey\\LaravelDDD, updating the namespace and introducing a new set of code generation stubs for actions, base models, view models, value objects, and DTOs. A new enum, LayerType, defines domain layers (Domain, Application, Custom). Additionally, a testing route file is added under the laravel-ddd prefix to expose configuration and autoloaded providers/commands for debugging.

routes, src/Enums, 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

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 watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 68 → 77 (+9.3)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 100 → 96 (-3.4)
  • Architecture 98 → 98 (-0.0)
  • Maturity 61 → 62 (+1.7)
  • Readiness 69 → 85 (+16.0)
  • Security 63 → 90 (+27.7)
  • Domain Modelling 100 → 100 (+0.0)

Resolved (13)

  • Change coupling: DomainDtoMakeCommand.php ↔ DomainModelMakeCommand.php (src/Commands/DomainDtoMakeCommand.php)
  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • Duplicated block (17 lines × 2) (src/Support/AutoloadManager.php)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • No exposed public API
  • Off-boarding risk: anonymized user #1
  • Test reliability not included

New (39)

  • AutoloadManager.cachedListenerMethodsExist (cognitive 16) (src/Support/AutoloadManager.php)
  • Dependency hygiene PARTLY measured — Composer dependencies read, no committed lock to grade for currency
  • Documentation: no architecture or design documentation (README.md)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • …and 19 more

Changes since last survey

  • 81 commits — 51 feature/other, 30 fixes

By area

  • (repo) — 14 commits
  • (root) — 12 commits
  • src/Support — 9 commits
  • src/ConfigManager.php — 8 commits
  • src/Commands — 6 commits
  • .github/scripts — 5 commits
  • tests/Config — 5 commits
  • .github/workflows — 4 commits
  • tests/Consumer — 4 commits
  • tests/Support — 4 commits
  • tests/Generator — 3 commits
  • tests/Compatibility — 2 commits
  • config/ddd.php — 1 commit
  • resources/boost — 1 commit
  • tests/.skeleton — 1 commit
  • tests/Autoload — 1 commit
  • tests/FixtureApplication.php — 1 commit

Notable commits

  • fix: Merge pull request #116 from jaspertey/fix/laravel-13-24-generator-signatures
  • fix: Merge pull request #118 from teylabs/fix/duplicate-event-registration
  • fix: Merge pull request #125 from teylabs/fix/controller-request-references
  • fix: Merge pull request #126 from teylabs/fix/config-array-preservation
  • fix: Merge pull request #127 from teylabs/fix/config-persistence
  • fix: Merge pull request #128 from teylabs/fix/disabled-cached-migrations
  • fix: Merge pull request #133 from teylabs/fix/stale-discovery-manifests
  • fix: Merge pull request #135 from teylabs/fix/subscriber-discovery-compatibility
  • fix: Merge pull request #137 from teylabs/fix/nested-factory-namespace
  • fix: fix(tests): remove directory symlinks the way Windows requires
  • fix: fix(tests): stop the skeleton copy enabling the symlink following it forbade
  • fix: fix(tests): tell Testbench's own vendor symlink apart from suite pollution
  • fix: fix: apply autoload filtering to listener and subscriber discovery
  • fix: fix: avoid duplicate domain event registrations
  • fix: fix: classify config options from the package schema and keep the merge hooks
  • fix: fix: dispatch every array option through mergeArray, in its original path shape
  • fix: fix: honor disabled migration discovery with cached paths
  • fix: fix: keep an absolute name absolute when resolving a forwarded request
  • fix: fix: keep ddd:* generator command names on Laravel 13.24+ (#115)
  • fix: fix: keep the resolve() hook scalar and the save type-safe
  • …and 61 more

Written by watchdog.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 22 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 4d124cacc28845dc2e898a766838d004b07e0589 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-821afab8930d.