somnambulist/read-models
Read models for Laravel: lightweight, query-optimized projections for CQRS applications. Build dedicated read-side models from domain events, separate reads from writes, and keep query performance predictable without loading full aggregates.
DB::table() + array returns, or full Eloquent models reused for reporting. This package is the middle option: typed read objects with minimal ceremony, so a PM can defer investing engineering time in a bespoke abstraction.DB::table() work that nobody owns.Consider it when:
Look elsewhere when:
To executives: This is a small, MIT-licensed utility that lets engineers build fast, read-only data views (dashboards, reports, listings) without heavy framework work. It reduces delivery time on reporting-style features and avoids locking us into a big CQRS investment. Risk is contained because it sits on the read path only — nothing transactional depends on it — and it can be swapped out for a thin in-house class later. Recommendation: pilot it on one internal, non-critical reporting surface, not on core domain code.
To engineering: It is a minimal active-record-style query layer for fetch-only reads. It gives you named read classes with explicit table and column definitions, returning typed results instead of ad-hoc arrays — a clean seam between controllers and the database. It is not an ORM and does not handle writes or migrations, so it composes with existing Eloquent rather than replacing it. Caveat to state plainly: single maintainer, low adoption, last tagged release March 2024; treat it as a pattern-with-a-package, keep it behind a small internal interface, and be ready to fork or reimplement if it stalls.
How can I help you explore Laravel packages today?