albertoarena/laravel-event-sourcing-generator
75.8
Adequate · 21 September 2026
1.7k
lines of production code
PHP
with JavaScript
4
measurements over time
What this system is
This system is a Laravel package that generates Spatie Event Sourcing domain structures from existing database migrations. It parses migration files to extract schema properties and scaffolds corresponding aggregates, reactors, projections, and notification classes. The tool also includes a documentation site and utilities for package distribution and quality scanning.
Features
Add specific exception classes for migration validation errors
The library now introduces dedicated exception classes to provide clearer error reporting during migration generation. New exceptions include MigrationDoesNotExistException for missing files, MigrationInvalidException for reserved keyword conflicts (create/update), MigrationInvalidPrimaryKeyException for invalid primary key definitions, and ParserFailedException for general parsing failures, allowing developers to handle these specific scenarios more precisely.
src/Exceptions · high confidence
Added PackageServiceProvider to register the MakeEventSourcingDomain command
A new PackageServiceProvider has been introduced in the src/Providers directory to register the MakeEventSourcingDomain console command. This ensures the command is automatically available when the application is running in the console, allowing users to generate event-sourcing domain components via the CLI.
src/Providers · high confidence
Added plumb-scan script for triggering quality re-scans
A new shell script, scripts/plumb-scan.sh, has been added to allow users to manually request an asynchronous quality re-scan of the package on plumbphp.dev. This tool sends a POST request to the public API endpoint, accepting optional vendor and package name arguments (defaulting to the current package), and reports the scan status or error messages to the console.
scripts · high confidence
Introduce CommandSettings configuration model for code generation
A new CommandSettings class has been added to manage configuration options for the command generation process. This model allows users to specify details such as the target model, domain, namespace, and root folder, while also controlling the generation of aggregates, reactors, and unit tests. It includes logic to automatically infer whether the Carbon library is required based on property types and supports configuration for UUID primary keys, indentation, and excluded migration fields.
src/Domain/Command/Models · high confidence
New Migration class for parsing and filtering database migrations
A new \Migration\ class has been introduced in the domain layer to handle the parsing and management of Laravel database migrations. This component scans the \database/migrations\ directory, applies optional exclusion filters via regex or string matching, and extracts migration properties and ignored fields using the \MigrationParser\. It exposes the primary column name, parsed properties, and ignored items, enabling downstream generators to accurately reflect existing schema structures while respecting user-defined exclusions.
src/Domain/Migrations · high confidence
New PHP parser traits for method and schema node handling
Added two new traits, HasMethodNode and HasSchemaUpNode, to the PhpParser domain. HasMethodNode provides a reusable mechanism to locate and process specific method statements within class nodes, while HasSchemaUpNode leverages this to specifically target the 'up' method in schema migrations, enabling more structured parsing of Laravel migration files.
src/Domain/PhpParser/Concerns · high confidence
New command to generate Spatie Event Sourcing domains
A new \make:event-sourcing-domain\ console command has been added to scaffold Spatie Event Sourcing domain structures. It supports generating domains from existing database migrations (with support for excluded columns and warnings on unsupported types) or via interactive prompts, and allows configuring options such as UUID primary keys, indentation, failed events, and various notification types (database, mail, slack, teams).
src/Console · high confidence
New contract interfaces for notification channels and default settings
Added two new interfaces to the command contracts: AcceptedNotificationInterface, which defines constants for supported notification channels (mail, slack, teams, database), and DefaultSettingsInterface, which defines the 'app' setting constant. These interfaces provide a standardized way to reference notification types and default application settings within the command domain.
src/Domain/Command/Contracts · high confidence
New event-sourcing code generation stubs with notification and failure support
The stubs directory now provides a comprehensive set of templates for generating event-sourced domain components, including actions (with and without aggregates), aggregates, data transfer objects, projections, projectors, and reactors. A significant addition is the support for notifications (Mail, Slack, Microsoft Teams, and database) and failed-event handling; the stubs now generate corresponding notification classes, concern traits, and projector/reactor logic to dispatch notifications or trigger failure events when operations fail.
stubs · high confidence
Behavioural changes
Documentation site migrated to Astro Starlight with automated reference generation
The documentation site has been rebuilt using Astro 7 and the Starlight theme, providing a modern, responsive documentation experience with a custom indigo/violet brand identity. To ensure accuracy, a new \bin/docs-sync.php\ tool automatically generates and updates key reference sections—including command options, compatibility matrices, and unsupported column lists—directly from the source code and CI configuration, eliminating manual drift. The site also includes a script for generating social cover images and is configured to run on Node 22.
bin, website · high confidence
New PHP parser models for migration property analysis
The generator now includes a new set of domain models in src/Domain/PhpParser/Models to parse and represent Laravel migration schema definitions. EnterNode provides a traversal structure for AST nodes, while MigrationCreateProperties and MigrationCreateProperty handle the collection and validation of column definitions, including support for dropColumn, renameColumn, and specific handling of primary keys (throwing an exception for uuid 'id' combinations). MigrationCreatePropertyType manages type normalization, nullable detection, and Carbon inference, enabling the generator to accurately translate migration blueprints into code structures.
src/Domain/PhpParser/Models · high confidence
Package distribution is slimmed by excluding development files
The Composer package archive is now significantly smaller because development-only files—such as CI workflows, documentation, tests, the website, and static analysis configurations—are excluded from the distributed \dist\ archive via \.gitattributes\ \export-ignore\ rules. This change reduces download size and clutter for end users without affecting the runtime functionality of the generator.
(repo-wide) · high confidence
Refactored stub generation with new Pipeline and StubResolver components
The stub generation system has been refactored to improve modularity and replace the abandoned \aldemeery/onion\ dependency with a new internal \Pipeline\ class for processing layers. A new \StubResolver\ class now handles the resolution of stub file paths and output destinations, while \StubReplacer\ manages the injection of model properties, ignored fields, and configuration settings into stub templates. Additionally, \StubCallback\ provides a mechanism for executing custom logic during stub processing, and the \Stubs\ class now supports conditional generation based on settings such as unit tests, failed events, notifications, reactors, and aggregates.
src/Domain/Stubs · high confidence
Support for JSONB columns and explicit handling of skipped/unsupported schema methods
The Blueprint generator now maps JSON and JSONB database columns to the 'array' built-in type, enabling proper serialization for these data structures. Additionally, it explicitly ignores database indexes, foreign key constraints, and soft delete methods during code generation, and marks specific column types (such as binary, ULID, and morphs) as unsupported to prevent invalid output.
src/Domain/Blueprint · high confidence
Support for dropColumn and renameColumn in migration parsing
The migration parser now recognizes and processes \dropColumn\ and \renameColumn\ operations within the \up()\ method. When a column is dropped, it is recorded in the properties list; when a column is renamed, the new name is recorded. Unsupported or skipped operations are tracked separately in an ignored list, allowing users to see which parts of their migration schema were not fully converted.
src/Domain/PhpParser/Traversers · high confidence
Support for generating notification-related directory structures
The code generator now creates dedicated directories for notifications when the corresponding setting is enabled. Specifically, the new \CanCreateDirectories\ concern ensures that \Notifications\ and \Notifications/Concerns\ folders are generated within the domain path, allowing users to organize notification classes and their associated concerns separately from other domain artifacts.
src/Domain/Command/Concerns · high confidence
Test coverage
Added test infrastructure for migration parsing and modification; Added test infrastructure for validating generated domain code; Added unit tests for migration property models and pipeline support; Added unit tests for the event-sourcing domain generation command.
Dependencies
Initial dependency manifests for Laravel package and documentation site
This change introduces the \composer.json\ and \composer.lock\ files for the \albertoarena/laravel-event-sourcing-generator\ package, establishing support for PHP 8.3, 8.4, and 8.5, and locking dependencies such as \nikic/php-parser\ and \spatie/laravel-event-sourcing\. It also adds the \package.json\ and \package-lock.json\ files for the \/website\ directory, configuring the documentation site with Astro 7.2.6, Starlight 0.41.8, and Sharp 0.35.3.
(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 63 → 76 (+12.3)
- Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 96 → 98 (+1.7)
- Architecture 100 → 87 (-13.4)
- Maturity 57 → 70 (+13.2)
- Readiness 59 → 72 (+12.7)
- Security 63 → 89 (+26.3)
Resolved (18)
- Coverage not included — suite not readable by the collector
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- 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)
- LLM evaluation failed
- No exposed public API
- Small-team knowledge concentration
- Test reliability not included
- Unpinned build actions
New (6)
- Documentation: written for insiders (docs/plans/completed/2026-07-01-claude-md-refactoring.md)
- Documentation: written for insiders (docs/plans/completed/2026-07-01-coverage-badge-refactoring.md)
- Inconsistent naming convention between Model and Parser. Migration uses snake_case methods (properties, ignored, migrations) while MigrationParser uses camelCase with 'get' prefix (getProperties, getIgnored). This breaks the expected interface consistency between the data holder and the parser that populates it.
- Inconsistent return types for 'primary' operations. Migration.primary() returns a nullable string (likely the column name), while MigrationCreateProperties.primary() returns a complex object (MigrationCreateProperty). This forces consumers to handle different types depending on which class they are querying.
- Outdated: nikic/php-parser
- Secret passed as a command-line argument
Changes since last survey
- 25 commits — 25 feature/other, 0 fixes
By area
- (root) — 10 commits
- website/package-lock.json — 9 commits
- .github/workflows — 5 commits
- docs/plans — 1 commit
Notable commits
- change: CI: Bump actions/checkout from 4 to 7 (#33)
- change: CI: Bump actions/deploy-pages from 4 to 5 (#35)
- change: CI: Bump actions/setup-node from 4 to 7 (#36)
- change: CI: Bump actions/upload-pages-artifact from 3 to 5 (#34)
- change: Chore(deps): Bump @astrojs/starlight from 0.41.1 to 0.41.6 in /website (#38)
- change: Chore(deps): Bump astro from 7.1.3 to 7.1.6 in /website (#37)
- change: Chore(deps): Bump js-yaml from 4.3.0 to 4.3.1 in /website (#40)
- change: Chore(deps): Bump league/commonmark from 2.8.2 to 2.10.0 (#41)
- change: Chore(deps): Bump nanoid from 3.3.17 to 3.3.18 in /website (#46)
- change: Chore(deps): Bump postcss from 8.5.16 to 8.5.25 in /website (#32)
- change: Chore(deps): Bump sharp from 0.35.2 to 0.35.3 in /website (#39)
- change: Chore(deps): Bump svgo from 4.0.1 to 4.0.2 in /website (#31)
- change: Chore(deps): Bump the composer-minor-patch group with 3 updates (#43)
- change: Chore(deps): Bump the website-minor-patch group (#42)
- change: Chore(deps): Bump the website-minor-patch group across 1 directory with 2 updates (#45)
- change: Chore(deps): Regenerate composer.lock on PHP 8.4 (#47)
- change: Chore: remove GitHub traffic badge and its token (#48)
- change: Docs: add 1.1.3 changelog entry (#50)
- change: Docs: add Why PHP badge to README (#49)
- change: Docs: add newsletter CTA to README
- …and 5 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
albertoarena/laravel-event-sourcing-generator 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 607d80e58bb35ce1b10831312c40fca3f50fb544 — 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-28e75b8e3254.