Skip to content
CAI
Software that uses CAICheck a score

SmoothPhp/CQRS-ES-Framework-Laravel

46.2

Weak · 21 September 2026

1.5k

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-integrated framework for implementing Command Query Responsibility Segregation (CQRS) and Event Sourcing patterns. It provides a complete infrastructure for managing domain events, including a database-backed event store, a command bus, and an asynchronous event dispatcher that processes events via a message queue. The framework also enforces strong consistency by tracking command IDs during asynchronous event processing.

Features

Add CQRS and Event Sourcing configuration

A new configuration file (config/cqrses.php) is introduced to manage settings for the CQRS and Event Sourcing framework. Users can now configure the Laravel event store, command bus, serializer, event dispatcher, event bus, and projection service providers. The file also allows customization of rebuild commands, transaction sizes, and queue names for both general events and individual handlers.

config · high confidence

Add Laravel-based EventStore implementation

Introduces a new \LaravelEventStore\ class that implements the \EventStore\ interface, enabling the application to persist domain events to a Laravel-managed database connection. This change provides a concrete, database-backed event store implementation for the Laravel adapter, handling event loading, appending (with duplicate playhead exception handling), and type-based event retrieval using generators.

src/EventStore · high confidence

Add console commands for importing, exporting, and rebuilding the event store and projections

Users can now import and export the event store via new \smoothphp:import\ and \smoothphp:export\ console commands, allowing data to be loaded from or saved to JSON files. Additionally, the \smoothphp:rebuild\ command has been introduced to rebuild projections, supporting optional database transactions and pre/post-rebuild hooks. The \smoothphp:project\ command allows running specific projections with optional transactional wrapping.

src/Console · high confidence

EventBus now supports asynchronous event processing via a new queue-based pipeline

The EventBus component has been expanded to include three new classes that enable asynchronous event handling. \PushEventsThroughQueue\ serializes domain messages and pushes them onto a configurable queue, while \QueueToEventDispatcher\ consumes these queued jobs, deserializes the payload, and dispatches the event. Additionally, \EventBusLogger\ was added to log domain events at the debug level. These changes introduce a queue-driven mechanism for event propagation, distinct from any synchronous handling.

src/EventBus · medium confidence

Introduce Laravel adapter for CQRS/ES infrastructure

The package now includes a Laravel adapter that registers core CQRS and Event Sourcing components within the Laravel service container. This includes a new \ServiceProvider\ that wires up the command bus, event store, event dispatcher, and event bus, alongside console commands for managing projections and event store imports/exports. Additionally, helper functions for waiting on command execution and generating UUIDs are provided.

src · high confidence

Introduce queued event dispatching via a new QueuedEventDispatcher

Added a new QueuedEventDispatcher that implements the EventDispatcher interface to handle event dispatching through a message queue. The dispatcher now pushes event handlers as queued jobs (via QueuedEventHandler) for multi-listener scenarios, while still executing single listeners synchronously. This change enables asynchronous processing of events, improving performance for heavy listeners by offloading them to a queue.

src/QueuedEventDispatcher · high confidence

Behavioural changes

Strong consistency enforcement via queued event processing with command ID tracking

The application now enforces strong consistency by routing domain events through a queue system that carries a command ID. A new \PushEventThroughQueueWithCommandId\ listener serializes domain messages and pushes them to a queue, including the current command ID. A corresponding \QueueToEventDispatcherWithCommandId\ job processes these events and caches the command ID in memory for a short duration, ensuring that subsequent operations can verify or enforce consistency based on the last executed command. A \StrongConsistencyCommandBusMiddleware\ is introduced to capture and expose the last command ID to the queueing mechanism.

src/StrongConsistency · medium confidence

Update project branding, documentation, and test configuration

The project has been rebranded from 'league/cqrs-es-framework-laravel' to 'smoothphp/cqrs-es-framework-laravel', updating all associated links and badges in the README. The README also now includes specific instructions for running the queue worker via Supervisor and publishing Laravel configuration files. Additionally, a PHPUnit configuration file (phpunit.xml.dist) was added to define the test suite and code coverage reporting, and the copyright holder's email address was updated in the LICENSE and README files.

(repo-wide) · medium confidence

Test coverage

Added tests for queued event dispatching

Added new test files to verify the behavior of the event dispatcher when events are pushed to a queue. This includes helper classes (TestEvent, TestHandler) and a PHPUnit test case (PushEventThoughDispatcherQueueTest) that exercises the QueuedEventDispatcher with a sync queue connection.

tests · high confidence

Dependencies

Upgrade to CQRS-ES-Framework v5 and Laravel integration

The package name is changed to smoothphp/cqrs-es-framework-laravel, and the dependency on smoothphp/cqrs-es-framework is upgraded from version \~1.0 to \~5.0. The minimum PHP version is raised to 7.0.0, and the project now requires laravel/framework ^5.1 instead of illuminate/support. Additionally, the package now includes a Laravel service provider for auto-discovery and adds a helper file (src/helpers.php) to the autoload files section.

(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

Score

  • CAI 46 → 46 (+0.6)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 100 → 100 (-0.3)
  • Architecture 69 → 69 (+0.0)
  • Maturity 46 → 46 (+0.0)
  • Readiness 24 → 26 (+1.4)
  • Security 100 → 100 (+0.0)

Resolved (5)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • No exposed public API
  • Test reliability not included
  • dormant codebase — no living knowledge left to concentrate

New (3)

  • Dependency hygiene PARTLY measured — Composer dependencies read, no committed lock to grade for currency
  • Documentation: no architecture or design documentation (README.md)
  • TodoComment (src/EventStore/LaravelEventStore.php)

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

Survey your own repository

SmoothPhp/CQRS-ES-Framework-Laravel 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 3fa9d89c203fab5aa735729328e1b212d5cd84e0 — 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.