Skip to content
CAI
Software that uses CAICheck a score

allysonsilva/laravel-artisan-domain-contexts

70.4

Strong · 21 September 2026

2.4k

lines of production code

PHP

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Laravel Artisan command generator that scaffolds classes, models, and policies. It provides tools for generating and managing code structures, with specific logic for namespace resolution and model qualification. The codebase has been updated to support Laravel 9.x, including compatibility adjustments for the Artisan console and test suite.

Behavioural changes

Refactor namespace resolution for generated classes and models

The command classes now use a more robust approach for determining namespaces. The \SeederMakeCommand\ implements a \rootNamespace\ method to correctly retrieve the application's root namespace. The \BuildClass\ trait's \getContextNamespace\ method now accepts an optional component folder argument to allow for more flexible namespace construction. Additionally, the \PolicyMakeCommand\ introduces a \qualifyModel\ method that intelligently resolves the fully qualified model class name, checking for existing namespaces, context options, and directory structures to ensure generated policies reference the correct model classes.

src/Commands · medium confidence

Updated Artisan console initialization for Laravel v9.x compatibility

The Artisan console initialization in src/Concerns/ArtisanConsoleTrait.php was modified to support Laravel v9.x. The change updates the console application setup by calling setContainerCommandLoader() on the resolved commands, ensuring compatibility with the new Laravel version.

src/Concerns · medium confidence

Updated documentation, CI configuration, and test behavior

The package documentation was expanded with a new 'Concepts' section explaining 'Domain' and 'Contexts', and the README table of contents was updated to include it. The CI configuration was modified: the .codacy.yml file was removed, and PHPStan was configured to ignore a specific generic class error in src/Commands/Concerns/InteractsWithChoices.php. Additionally, the PHPUnit configuration was changed to stopOnError and stopOnFailure, ensuring that test failures do not halt the test suite execution.

(repo-wide) · high confidence

Test coverage

Updated test suite for Laravel 9.x compatibility

The test suite was updated to support Laravel v9.x. This includes adding a new unit test for the \PolicyMakeCommand\ to verify model context handling, and refactoring existing tests in \CommandOptionsTest\, \FactoryMakeCommandTest\, \FreshCommandTest\, \MigrateCommandTest\, \MigrateMakeCommandTest\, \ModelMakeCommandTest\, and \RefreshCommandTest\ to align with Laravel 9.x changes, such as updated console output patterns and configuration defaults.

tests · high confidence

Dependencies

Upgrade Laravel framework and dev dependencies to support Laravel 9.x

The project now requires Laravel 9.x (up from 8.x) and updates dev dependencies including larastan to 2.0 and orchestra/testbench to 7.0. Additionally, composer configuration was updated to allow specific plugins and the unit test script was modified to explicitly set the memory limit.

(dependencies) · high confidence

Housekeeping

Whitespace adjustment in ClassIterator constructor

A blank line was added in the ClassIterator constructor, likely to improve code formatting or readability. This is a minor stylistic change with no impact on functionality.

src/Tools · 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 69 → 70 (+1.4)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 100 → 100 (-0.2)
  • Architecture 100 → 89 (-10.7)
  • Maturity 61 → 61 (+0.0)
  • Readiness 69 → 69 (-0.5)
  • Security 70 → 86 (+16.2)

Resolved (22)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • Duplicated block (15 lines × 2) (src/Commands/Database/Factories/FactoryMakeCommand.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)
  • 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
  • early-stage repository — too little history to judge knowledge freshness
  • git history depth insufficient
  • …and 2 more

New (26)

  • Dependency hygiene PARTLY measured — Composer dependencies read, no committed lock to grade for currency
  • Documentation: no usage examples (README.md)
  • Duplicated block (15 lines × 3) (src/Inputs/Context.php)
  • Duplicated block (15–17 lines × 2) (src/Commands/Database/Factories/FactoryMakeCommand.php)
  • Duplicated block (8 lines × 2) (src/Providers/ArtisanServiceProvider.php)
  • End-of-life framework: Laravel 9
  • 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 6 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

allysonsilva/laravel-artisan-domain-contexts 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 21 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 36b67d0e92a69a18f57c2cdb40eb38c82590523e — 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-fa71c66cabd8.