Skip to content
CAI
Software that uses CAICheck a score

nWidart/laravel-modules

65.4

Adequate · 17 November 2026

13.1k

lines of production code

PHP

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add Module facade method to prohibit destructive database commands

The Module facade now exposes a static \prohibitDestructiveCommands\ method that allows users to prevent the execution of potentially dangerous database operations (\module:migrate-fresh\, \module:migrate-refresh\, and \module:migrate-reset\). When this method is called with \true\, it delegates to the underlying migration commands to enforce the prohibition, providing a centralized control point for database safety within the module system.

src/Facades · high confidence

Add ModuleEvent constants for module lifecycle events

A new ModuleEvent constant class has been introduced to define standard event names for module lifecycle operations, including boot, register, enabling/disabling, creating/deleting, and usage states. This provides a centralized, consistent set of string identifiers for these events across the application. Also in this area: 1 commit (0 fixes) modifying (repo-wide).

src/Constants · low confidence · unverified

Added Inertia.js stubs for React, Vue, and Svelte

New stub files have been added to the \src/Commands/stubs/inertia\ directory to support scaffolding Inertia.js applications with React, Vue 3, and Svelte. These stubs include entry-point configurations (\app-\.stub\) that initialize the Inertia app and resolve page components from both the main application and module directories, as well as template stubs for pages (\page-\.stub\) and components (\component-\*.stub\) tailored to each framework's syntax.

src/Commands/stubs/inertia · high confidence

Adds project configuration and tooling files

Introduces standard development configuration files including .editorconfig for consistent coding styles, .gitattributes to exclude development artifacts from packaged releases, and .php-cs-fixer.dist.php to enforce PSR-12 compliance. Additionally, adds pint.json for Laravel preset formatting, phpunit.xml.dist for test execution, and .travis.yml for continuous integration, while updating .gitignore to exclude build and cache artifacts.

(repo-wide) · high confidence

Introduce file-based module activation status storage

A new FileActivator class has been added to manage module activation states by reading and writing status data to a JSON file. This implementation persists module enable/disable actions to disk, allowing the system to track which modules are active across requests without relying on in-memory state or a database.

src/Activators · high confidence

Laravel-specific module implementation and Vapor compatibility

This change introduces Laravel-specific implementations for module handling, including a new \LaravelFileRepository\ and \Module\ class that extend the base module functionality. The \Module\ class now includes logic to detect Laravel Vapor environments via the \modules.vapor\_maintenance\_mode\ config setting, ensuring that cached service paths are written to a writable location compatible with Vapor's constraints. Additionally, provider and alias registration methods are implemented to leverage Laravel's native \ProviderRepository\ and \AliasLoader\ for proper integration.

src/Laravel · high confidence

Lumen 5.5.x support via dedicated Lumen module and file repository classes

Users running Lumen can now use the module system with Lumen-specific implementations. The diff introduces \src/Lumen/LumenFileRepository.php\ and \src/Lumen/Module.php\. \LumenFileRepository\ extends the base \FileRepository\ to provide Lumen-specific module creation. \Module\ extends the base \Module\ class to override \getCachedServicesPath\ (customizing the service cache file name to include the snake-cased module name) and \registerProviders\ (iterating through providers to register them with the Lumen application container), while \registerAliases\ is implemented as a no-op, reflecting Lumen's lack of alias support.

src/Lumen · high confidence

Lumen support and module manifest-based service provider registration

The package now supports Lumen 5.5.x alongside Laravel, introducing a dedicated \LumenModulesServiceProvider\ that registers a \LumenFileRepository\ and configures stub paths. Module service providers are no longer loaded via the legacy bootstrap process; instead, a new \ModuleManifest\ class builds a manifest of enabled modules and their providers, which is then loaded by the \ModulesServiceProvider\ using Laravel's \ProviderRepository\. This change also includes a \@module()\ Blade directive for status checks, a \module()\ helper function, and Vite integration via a \module\_vite()\ helper and a publishable \vite-module-loader.js\ script.

src · high confidence

New dedicated commands for publishing module assets, config, migrations, translations, and Inertia files

The \src/Commands/Publish\ directory now contains five new console commands that allow users to publish specific module resources individually: \module:publish\ for general assets, \module:publish-config\ for configuration files (with dynamic service provider resolution), \module:publish-migration\ for database migrations, \module:publish-translation\ for language files, and \module:publish-inertia\ for frontend app.js stubs (supporting Vue, React, and Svelte). These commands provide granular control over which module components are copied to the application, replacing or supplementing broader publishing mechanisms. Also in this area: 2 commits (1 fix) modifying src/Commands; 5 commits (3 fixes) fixing src/Commands/Publish.

src/Commands/Publish · medium confidence · unverified

New migration parsing classes for schema and name analysis

Added NameParser and SchemaParser classes to the Nwidart\\Modules\\Support\\Migrations namespace. NameParser analyzes migration file names to determine the schema action (create, delete, add, drop) and target table. SchemaParser converts schema definition strings into structured arrays and generates the corresponding Laravel migration code, including support for foreign key constraints via relationship keys.

src/Support/Migrations · high confidence

New module:make-\* commands for generating various module artifacts

The \src/Commands/Make\ directory now contains a comprehensive suite of new console commands for scaffolding module components. Users can generate Actions, Casts, Enums, Exceptions, Helpers, Interfaces, Listeners, Observers, Repositories, and Service Providers using dedicated commands (e.g., \module:make-action\, \module:make-enum\). The suite also includes commands for Inertia integration (\module:make-inertia-component\, \module:make-inertia-page\) with support for Vue, React, and Svelte, as well as enhanced generation for Controllers, Models, and Resources with additional flags like \--invokable\, \--api\, and \--all\. A new \module:make-replacement\ command allows for creating custom stub replacement keys.

src/Commands/Make · high confidence

New script to collect Vite module asset paths

A new \scripts/vite-module-loader.js\ script has been added to the project. This utility reads the \modules\_statuses.json\ file to identify enabled modules and dynamically imports their individual \vite.config.js\ files to aggregate their configured asset paths. This enables the build system to automatically discover and include assets from specific, enabled Vite modules.

scripts · high confidence

New support classes for module service providers, stubs, and key replacement

This change introduces three new classes in the Nwidart\\Modules\\Support namespace to enhance module generation and configuration handling. ModuleServiceProvider provides an abstract base for module service providers, centralizing the registration of commands, schedules, translations, config, and views, while also adding a check to skip config merging when the configuration is cached. Stub offers a reusable mechanism for loading and rendering stub files with placeholder replacements, falling back to default stubs if overrides are not found. ReplacementKeyCommand serves as an abstract base for commands that handle key replacement logic during module generation. Also in this area: 1 commit (0 fixes) modifying (repo-wide); 11 commits (6 fixes) fixing src/Support.

src/Support · low confidence · unverified

New traits for path/namespace handling and cache clearing; migration and command traits updated

Two new traits are introduced in src/Traits: PathNamespace provides methods to generate and clean module namespaces and paths (e.g., studly\_path, path\_namespace, module\_namespace, clean\_path, app\_path), and CanClearModulesCache adds a clearCache method that resets the modules cache via resetModules. Existing traits are updated: MigrationLoaderTrait’s loadMigrationFiles and getMigrationGeneratorPath now have explicit string type hints and their docblocks are removed, and ModuleCommandTrait’s getModuleName now uses the app() helper instead of the Laravel container to resolve the modules service, with its docblock removed.

src/Traits · high confidence

Behavioural changes

1 commit (0 fixes) modifying art

A change to existing behaviour in art — 1 commit, 2 files: “docs: rewrite README and add social preview image (\#2194)” (refs \#2194).

art, phpstan · medium confidence · unverified

3 commits (0 fixes) modifying .ai, src/Commands

A change to existing behaviour in .ai, src/Commands — 3 commits, 9 files: “feat(make-model): add --attributes flag for attribute-style models (\#2243)”; “feat(make): add --json-api option to module:make-resource (\#2241)”; “feat(commands): add module:make-config and module:make-job-middleware (\#2242)” (refs \#2243, \#2241, \#2242). Also in this area: 1 commit (1 fix) fixing .ai; Added Laravel Modules development guidelines and skills for Laravel Boost.

.ai · medium confidence · unverified

87 commits (16 fixes) modifying src/Commands

A change to existing behaviour in src/Commands — 87 commits (16 fixs), 12 files: “Refactor DocBlocks for clarity and readability”; “Added force option to module:seed command (\#32)”; “\[refactor\] refactor module:migrate-refresh command”; and 81 more (refs \#32, \#2211, \#220, \#2212, \#2244, …).

src/Commands · medium confidence · unverified

Command registration refactored to support configuration overrides and expanded command set

The ConsoleServiceProvider now registers commands by merging a new, expanded list of default commands with any custom commands defined in the \modules.commands\ configuration file, allowing users to override or extend the command set. The provider also removes the deprecated \defer\ property and switches to using fully qualified class names (e.g., \Commands\\Make\\ControllerMakeCommand::class\) instead of string concatenation for command registration. Additionally, the ContractsServiceProvider updates the \RepositoryInterface\ binding to explicitly use \LaravelFileRepository\, aligning with the preparation for a database implementation.

src/Providers · high confidence

Comprehensive stubs overhaul for modern Laravel compatibility

The stubs in src/Commands/stubs have been completely rewritten to align with modern Laravel standards (5.5+ through 8+). Key changes include: replacing the legacy \fire()\ method with \handle()\ in console commands and updating \$name\ to \$signature\; switching controllers to extend \App\\Http\\Controllers\\Controller\ and adding full CRUD methods; updating models to use the \HasFactory\ trait and factories to extend \Illuminate\\Database\\Eloquent\\Factories\\Factory\; modernizing service providers to use \register()\ and \provides()\ with return types, and updating the route service provider to use \map()\ and \boot()\ instead of \before()\ and \map()\ with Router injection; adding support for Vite via \vite.stub\ and \package.stub\ (replacing Laravel Mix); introducing new stubs for invokable actions/helpers, enums, casts, scopes, and Inertia controllers; and updating the \composer.stub\ to include \autoload-dev\ and \extra.laravel\ for auto-discovery.

src/Commands/stubs · high confidence

Database commands restructured with new options and confirmation flows

The database management commands (migrate, migrate-fresh, migrate-refresh, migrate-reset, migrate-rollback, migrate-status, and seed) have been moved into a new \Database\ subdirectory and refactored to extend \BaseCommand\ instead of Laravel's base \Command\. This change introduces a \direction\ option (defaulting to 'asc' for migrate, 'desc' for reset/rollback) to control migration ordering, adds a \subpath\ option to \migrate\ and \migrate-rollback\ for targeting specific migration directories, and implements the \ConfirmableCommand\ interface on \migrate-fresh\ and \migrate-reset\ to enforce confirmation steps. Additionally, \migrate-fresh\ now explicitly handles root-level migrations after wiping the database, and \migrate-rollback\ now accepts a \subpath\ argument to limit rollbacks to specific module migration files. Also in this area: 2 commits (1 fix) modifying src/Commands; 9 commits (5 fixes) fixing src/Commands/Database; 1 commit (1 fix) fixing src/Commands.

src/Commands/Database · medium confidence · unverified

Default route stubs now include authentication middleware

The generated route stubs for new modules now apply authentication middleware by default. The API route stub (api.stub) uses the 'auth:sanctum' middleware with a 'v1' prefix, while the web route stub (web.stub) applies 'auth' and 'verified' middleware. This ensures that newly generated module routes are protected out of the box, aligning with the project's security posture for modules.

src/Commands/stubs/routes · high confidence

FileGenerator now supports overwriting existing files

The FileGenerator class now includes a \withFileOverwrite\ method that allows generated files to overwrite existing ones. Previously, the generator would silently skip files that already existed; with this change, users can explicitly enable overwriting during file generation. Additionally, the \FileAlreadyExistException\ has been moved to the \Nwidart\\Modules\\Exceptions\ namespace, and type hints have been added to the \FileGenerator\ and \ModuleGenerator\ classes for better code clarity and static analysis support.

src/Generators · high confidence

Major restructuring of module generation configuration and stubs

The module configuration has been significantly overhauled to align with modern Laravel conventions and improve customization. The default module namespace path has changed from 'modules' to 'Modules', and the 'app\_folder' setting now defaults to 'app/'. The stub system is expanded to support separate web and API route files, Vite configuration, and new asset stubs (JS/Sass), while replacing the old 'module.json' stub with a dynamic generation approach. The generator configuration now uses a granular, nested structure for each component type (e.g., models, controllers, events), allowing users to explicitly define paths and enable/disable generation for specific folders like Actions, Casts, or Jobs, which were previously fixed or absent.

config · high confidence

Migration stubs updated to use anonymous classes and Laravel 11 conventions

The migration stubs in src/Commands/stubs/migration have been refactored to generate anonymous classes instead of named classes, aligning with modern Laravel conventions. Additionally, the 'create' and 'drop' stubs now use the $table-\>id() method for primary keys instead of $table-\>increments('id'), and the 'drop' stub uses Schema::dropIfExists() for safer table removal. All stubs also include the Schema facade import, use void return types for up/down methods, and follow PSR-2 formatting standards.

src/Commands/stubs/migration · high confidence

Migrator now supports sub-paths, explicit database connections, and configurable migration paths

The Migrator class has been updated to allow specifying a sub-path for module-specific migration files, enabling more granular organization of migration scripts. It now accepts an explicit database connection via a new setDatabase method, ensuring that migration operations target the correct database instance rather than relying on defaults. Additionally, the migration path resolution logic has been refactored to read from a configurable 'migration' path setting, allowing users to customize where migrations are stored. The class also includes improvements to handle anonymous migration files by checking file existence before instantiation, and uses modern PHP syntax and type hints throughout.

src/Migrations · high confidence

Module repository interface expanded and method names standardized

The module repository interface has been significantly expanded to support new capabilities and stricter typing. New methods have been added for configuration access (config), file system interaction (getFiles), module lifecycle management (boot, register), asset path resolution (assetPath), and module deletion (delete). The interface also introduces specific checks for module activation status via isEnabled and isDisabled, replacing the previous generic status queries. Several existing methods have been renamed for clarity: enabled and disabled are now allEnabled and allDisabled, and return types have been added to methods like scan, toCollection, and count to improve type safety and IDE support.

src/Contracts · high confidence

New specific exception classes for module configuration and asset errors

The library now includes dedicated exception classes to provide clearer error reporting for specific failure scenarios. A new \InvalidActivatorClass\ exception is thrown when the activator configuration is missing or outdated, offering a static helper to guide users toward running the vendor publish command. Additionally, \InvalidAssetPath\ is introduced to catch cases where a module name is missing from an asset path, while \FileAlreadyExistException\ and \InvalidJsonException\ are added to handle file and JSON validation errors respectively. The existing \ModuleNotFoundException\ has also been simplified.

src/Exceptions · high confidence

Publishing classes adopt strict typing and new configuration/migration dependencies

The publisher classes in src/Publishing now use strict PHP types for properties and return values, removing legacy docblock-only type hints. AssetPublisher and LangPublisher have switched from reading paths via the repository to using the new GenerateConfigReader, while MigrationPublisher now accepts a Migrator instance to determine source paths, decoupling it from the generic repository config for migration-specific logic. Also in this area: 1 commit (0 fixes) modifying (repo-wide); 5 commits (4 fixes) fixing src/Publishing.

src/Publishing · low confidence · unverified

Refactored generator path configuration to support structured namespace resolution

The configuration system for module generation paths has been updated to use a new \GeneratorPath\ class and \GenerateConfigReader\. This change allows generator settings to be defined as structured arrays containing \path\, \generate\, and optional \namespace\ keys, rather than simple strings or booleans. When a namespace is not explicitly provided, it is automatically derived from the path relative to the application folder, ensuring consistent namespace generation for newly created module components. Also in this area: 1 commit (0 fixes) modifying (repo-wide); 4 commits (3 fixes) fixing src/Support/Config.

src/Support/Config · low confidence · unverified

Refactored module installation and update processes with modern PHP types and improved Composer handling

The module installation and update workflows have been refactored to improve type safety and performance. The Installer class now uses strict PHP 8+ typed properties and interfaces (RepositoryInterface), and simplifies its git installation logic by replacing a switch statement with direct conditional checks. The Updater class has been significantly enhanced: it now installs both require and require-dev packages in single Composer calls instead of one-by-one, supports silencing Composer output via configuration, and automatically merges module scripts into the main project's composer.json file.

src/Process · high confidence

Simplified module service provider stub

The generated module service provider stub has been refactored to extend \ModuleServiceProvider\ instead of the base Laravel \ServiceProvider\. This change removes the manual implementation of config, view, and translation registration methods, as well as the deprecated \defer\ property, relying on the parent class to handle these registrations. The new stub also introduces properties for the module name and includes pre-configured arrays for registering event and route service providers, streamlining the boilerplate for new modules.

src/Commands/stubs/scaffold · high confidence

Updated view stubs to use Laravel Blade components and modern HTML structure

The generated view stubs have been refactored from the legacy @extends/@section/@yield syntax to Laravel's modern component-based layout system (\<x-...\>). The index stub now wraps content in a component tag, and the master stub has been updated to use {{ $slot }} for content injection, includes a CSRF token meta tag, adds standard SEO meta tags, integrates the Figtree font via BunnyCDN, and prepares placeholders for Vite asset compilation (currently commented out).

src/Commands/stubs/views · high confidence

Fixes

16 commits (10 fixes) fixing src/Commands/Actions

A fix in src/Commands/Actions — 16 commits (10 fixs), 13 files: “fix: register module aliases, fix module:list --only=priority and the module cache path (\#2206)”; “fix(install): keep composer.json and phpunit.xml intact and handle failed installs (\#2211)”; “fix: fail module:lang on missing translations, read plural generator namespaces, fix --force help (\#2215)”; and 13 more (refs \#2206, \#2211, \#2215, \#2203, \#2212, …). Also in this area: 2 commits (1 fix) modifying src/Commands; Module management commands restructured with new interactive actions.

src/Commands/Actions · medium confidence · unverified

Test coverage

3 commits adding/updating tests in tests/Migrations; 43 commits adding/updating tests in tests; Added snapshot tests for FileActivator JSON output; Added test stubs for feature and unit tests; Added test stubs for the Recipe module; Added tests for FileActivator module status management; Added unit tests for module contracts, facades, and support utilities; Initial test suite for module management and commands; Initial test suite for module management and commands.

Dependencies

Major dependency upgrade to PHP 8.3 and Laravel 13

The package has been upgraded to require PHP 8.3 and Laravel 13, dropping support for older versions. This change removes legacy dependencies such as \pingpong/generators\, \pingpong/support\, and \laravelcollective/html\, while introducing new dev tools including \laravel/pint\, \phpstan/phpstan\, and \spatie/phpunit-snapshot-assertions\. The minimum PHPUnit version is now 12, and the \wikimedia/composer-merge-plugin\ is added as a runtime dependency to support external configuration merging.

(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

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 60.2 → 65.4 (+5.2)
  • Rubric changed (rubric-2026.11.2 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 60.9 → 66.8 (+5.9)
  • Architecture 86.7 → 87.2 (+0.5)
  • Maturity 62.8 → 62.2 (-0.6)
  • Readiness 79.1 → 79.1 (0.0)
  • Security 75.0 → 71.0 (-4.0)
  • Accessibility 52.4 → 62.9 (+10.5)
  • Performance 100.0 → 100.0 (0.0)

Resolved (3)

  • Duplicated block (68 lines × 2) (src/Commands/Make/MiddlewareMakeCommand.php)
  • Off-boarding risk: anonymized user #1
  • Projects may be oversized for their cohesion

New (29)

  • Circular dependency (src/FileRepository.php)
  • Edited copies of one member (5 members, 4+ corresponding lines) (src/Commands/Make/ComponentClassMakeCommand.php)
  • Edited copy of a member (10 corresponding lines) (src/Commands/Publish/PublishMigrationCommand.php)
  • Edited copy of a member (12 corresponding lines) (src/Generators/ModuleGenerator.php)
  • Edited copy of a member (3 corresponding lines) (src/Commands/Make/ClassMakeCommand.php)
  • Edited copy of a member (34 corresponding lines) (src/Commands/Database/MigrateResetCommand.php)
  • Edited copy of a member (5 corresponding lines) (src/Commands/Actions/UpdateCommand.php)
  • Edited copy of a member (5 corresponding lines) (src/Commands/Make/ConfigMakeCommand.php)
  • High: security finding (details withheld)
  • Off the main sequence: src/Constants
  • Off the main sequence: src/Exceptions
  • Off the main sequence: src/Traits
  • Off-boarding risk: anonymized user #1
  • Orphaned file (src/Commands/Actions/ModelShowCommand.php)
  • Orphaned file (src/Commands/Make/ActionMakeCommand.php)
  • Orphaned file (src/Commands/Make/ExceptionMakeCommand.php)
  • Orphaned file (src/Commands/Make/FactoryMakeCommand.php)
  • Orphaned file (src/Commands/Make/HelperMakeCommand.php)
  • Orphaned file (src/Commands/Make/InertiaComponentMakeCommand.php)
  • Orphaned file (src/Commands/Make/InertiaPageMakeCommand.php)
  • …and 9 more

Changes since last survey

  • 3 commits — 3 feature/other, 0 fixes

By area

  • (root) — 2 commits
  • .github/workflows — 1 commit

Notable commits

  • change: chore(deps-dev): allow phpunit/phpunit ^13.0 alongside ^12.0 (#2252)
  • change: chore: remove the trail code map tooling (#2254)
  • change: ci: add PR-Agent reviewer using Claude Sonnet (#2253)

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

Survey your own repository

nWidart/laravel-modules 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 17 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 c04f0d4d35af9a46c9816d7e43f8d656c50634b5 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — 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.84+preprod-d645ca9bbedd.