Skip to content
CAI
Software that uses CAICheck a score

harris21/laravel-aegis

70.0

Strong · 22 September 2026

1.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

Aegis is a Laravel package that automates the creation and validation of Value Objects. It provides a CLI to scaffold Value Object classes, generate corresponding tests, and automatically wire them into Eloquent models. The system also includes a scanner to identify database columns suitable for conversion into Value Objects, alongside a validation rule to enforce type safety during request handling.

Features

Add ResolvesValueObjects trait for FormRequest value object resolution

A new ResolvesValueObjects trait is added to src/Concerns, providing a valueObject() method on FormRequest instances. This allows controllers to retrieve validated input as strongly-typed Value Object instances by inspecting the request's rules() for a Rule::valueObject() entry, with memoization and null handling for optional fields.

src/Concerns · high confidence

Add ValueObjectRule for Laravel validation

A new \ValueObjectRule\ class has been added to \src/Rules/ValueObjectRule.php\. This class implements Laravel's \ValidationRule\ interface, allowing any Value Object class to be used directly as a validation rule. The rule attempts to instantiate the specified Value Object with the input value; if the constructor throws an exception, the rule fails with an appropriate error message, supporting a custom \validationMessage\ method on the Value Object for safe error reporting.

src/Rules · high confidence

Add vo:scan command for finding Value Object candidates

A new \vo:scan\ command has been added to the Aegis console, allowing users to automatically scan their Laravel models and migrations to identify columns that can be converted into Value Objects. The scanner extracts column names from Eloquent models and database migrations, then matches them against a set of predefined patterns (such as email, URL, UUID, IP address, slug, and country/currency codes) to suggest appropriate Value Object types. For columns that don't fit the standard patterns (like status enums or money), the scanner marks them as candidates for manual review. This feature provides automated refactoring suggestions for common data types, streamlining the process of identifying and implementing value objects in a Laravel application.

src/Console/Scanner · high confidence

Introduce Value Object scaffolding and validation rules

The Aegis package now provides a command-line interface for generating Value Objects, including a new \make:value-object\ command and a \vo:scan\ command to find candidates. Users can now use the \Rule::valueObject()\ macro for validation and access published stubs for Value Objects and their corresponding PHPUnit or Pest tests.

src · high confidence

Introduce value object scaffolding with automatic Laravel cast wiring

The \src/Console/Generators\ directory now includes three new generators: \ValueObjectGenerator\ creates PHP value objects with configurable normalizers, validation rules, and method stubs; \TestGenerator\ produces test stubs that automatically detect whether to use Pest or PHPUnit; and \CastWirer\ automatically inserts the generated value object into a Laravel model's \casts()\ method, falling back to a manual snippet if the model structure is incompatible.

src/Console/Generators · high confidence

Introduce vo:scan command and update README

A new \vo:scan\ Artisan command is added to automatically detect Value Object candidates by analyzing Eloquent models and migrations for common column patterns, with support for \--json\, \--no-cast\, and \--path\ flags, as well as automatic detection of \nwidart/laravel-modules\. The README is updated to explain the package's purpose, add a logo and pronunciation hint, and clarify that Aegis registers a \valueObject\ macro on Laravel's \Rule\ class. Additionally, \phpunit.xml\ is updated to exclude \tests/Fixtures\ from test discovery, and \CHANGELOG.md\ is removed.

(repo-wide) · high confidence

New \`make:value-object\` command and \`vo:scan\` analysis tool

Users can now scaffold Value Objects directly from the command line using \make:value-object\, which generates the PHP class, a Pest test stub, and optional Eloquent cast wiring. The new \vo:scan\ command analyzes Eloquent models and migrations to suggest columns that would benefit from a Value Object, and automatically includes nwidart/laravel-modules directories during the scan unless explicitly disabled.

src/Console · high confidence

New stubs for generating Value Object classes and tests

The framework now provides new stub templates for generating Value Object classes and their corresponding test files. The new value-object.stub template generates a readonly class implementing Castable, Stringable, and JsonSerializable interfaces, while the new value-object-test.stub and value-object-test-phpunit.stub templates provide starter tests for both Pest and PHPUnit environments.

src/Console/Stubs · high confidence

Fixes

Add safe accessors for console options and arguments

A new trait, ResolvesConsoleInput, is added to provide safe accessors for console options and arguments. This addresses type-safety issues with Symfony's broadly-typed option() and argument() methods, ensuring that string and array values are properly coerced and filtered to prevent type errors at PHPStan level 7.

src/Console/Concerns · medium confidence

Test coverage

Added test fixtures and unit tests for value object validation; Added test helper for recursive directory removal; Added tests for ValueObjectRule validation behavior; Added unit tests for the ResolvesValueObjects trait; Added unit tests for the Scanner subsystem; Added unit tests for the vo:scan command; Added unit tests for value object, test, and cast wirer generators.

Dependencies

Add static analysis and code style tools

The project now includes Larastan (version 3.10) and Laravel Pint (version 1.0) as development dependencies, along with a new 'analyse' script in composer.json to facilitate static analysis and code style enforcement.

(dependencies) · medium 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 67 → 70 (+2.7)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 98 → 99 (+1.0)
  • Architecture 100 → 100 (-0.2)
  • Maturity 59 → 59 (+0.0)
  • Readiness 68 → 60 (-7.3)
  • Security 68 → 100 (+32.3)

Resolved (15)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • Duplicated block (12 lines × 2) (src/Console/Scanner/Scanner.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
  • Test reliability not included
  • The 'Scan your codebase for Value Object candidates' and 'Flags' sections are present in the outline but not shown in the clipped text. (README.md)
  • The quick start section begins with 'Scaffold a Value Object' then clips before explaining how to validate against the same Value Object (e.g., in a FormRequest). (README.md)
  • early-stage repository — too few commits for a meaningful bus factor
  • early-stage repository — too little history to judge knowledge freshness

New (14)

  • Dependency hygiene PARTLY measured — Composer dependencies read, no committed lock to grade for currency
  • Documentation: no architecture or design documentation (README.md)
  • Duplicated block (12 lines × 2) (src/Console/Scanner/Scanner.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)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • No dependency advisory monitoring
  • Workflow token permissions not restricted

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

Survey your own repository

harris21/laravel-aegis 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 ed62159ecff9fabe9032aad73339c8d6632a3b72 — 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.