kobykorman/eloquentify
Eloquentify turns one custom SQL query with JSON-aggregated relations into fully hydrated nested Eloquent models, collapsing N+1 and R+1 round trips into a single query with zero configuration.
Good fit:
Look elsewhere when:
preventLazyLoading in non-prod to catch regressions, relation-count caches, or narrower endpoint payloads. Try those first; they carry no new dependency.To executives: A narrowly scoped, free (MIT) library that cuts database round trips on our slowest nested screens — typically the difference between a page making dozens of sequential database calls and making one. It requires no procurement, no vendor commitment, and no rewrite; it is applied per endpoint, so we can measure value on one screen before expanding. The honest caveat: it is a young project with a single maintainer and no known production adopters, so I recommend treating it as a tactical accelerator, isolating it behind our data layer, and budgeting a small amount of engineering ownership.
To engineering: Add one trait to a base model, then write a single query that aggregates each relation into a JSON column named after the relation method — the package returns fully hydrated, nested Eloquent models, so controllers and resources keep the Eloquent API they already use. It is opt-in per query, so adoption is incremental and reversible. Costs: raw SQL enters the codebase, behavior is database-specific, and we should add tests plus a fork plan given the low community footprint. Recommended next step: a spike on one high-traffic endpoint with before/after query counts and p95 latency as the decision gate.
How can I help you explore Laravel packages today?