Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Eloquentify Laravel Package

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.

View on GitHub
Deep Wiki
Context7
v2.1.0

Added

  • Laravel 13 support (laravel/framework ^13.0), verified against Laravel 13.x with the full test suite passing

Changed

  • Dev tooling now spans the Laravel 13 stack: Testbench ^11.0, Pest ^4.0, pest-plugin-laravel ^4.0
  • CI matrix runs Laravel 11, 12, and 13 (Laravel 13 on PHP 8.3+, its minimum)
v2.0.0

Complete redesign: JSON-aggregation hydration replaces the v1 column-prefix scheme.

Changed

  • Relations arrive as JSON-aggregated columns (json_agg/json_build_object and equivalents) named after the model's relation methods, instead of prefixed flat columns
  • eloquentify($result) no longer takes a relations hierarchy: relations are detected from the model's relation methods (which must declare relation return types)
  • No row multiplication for sibling "many" relations, no column prefix conventions, no prefix collisions
  • Use any method name for the relation: alias the column after the method, including two relations to the same model and self-references
  • Requires PHP 8.2+ and Laravel 11+

Added

  • BelongsToMany pivot hydration via a pivot key (custom pivot classes and ->as() accessors supported)
  • Null/empty relation handling (NULL, [], [null])
  • Fail-fast errors for ambiguous columns, invalid JSON, shape mismatches, and scalar elements in to-many arrays
  • Lowercased aliases (unquoted in Postgres) are canonicalized to the relation method's name
  • Protected relation methods are supported
  • Relation lookups are cached per model class and column

Removed

  • ModelMeta, the relations-hierarchy argument, and the column prefix scheme

See the README for the new usage.

v1.0.2

Documentation

  • Corrected relation naming examples — method names derive from the class basename, so author() returning User was never supported
  • Fixed syntax errors in the Quick Start samples
  • Documented that hierarchies must be composed inside a model class (nest() is protected)
  • Documented silent failure modes and limitations: missing primary keys, plural-over-singular precedence, uncountable basenames, one relation per class per parent, self-references, morphTo, pivot data, prefix collisions at every level and across branches, row-value conflicts
  • Announced the v2 direction (JSON aggregation)
v1.0.1

Fixed

  • Prefix stripping corrupted attribute names containing the prefix again later in the name (e.g. post_repost_id hydrated as reid)

Documentation

  • Root columns must not start with a nested model's prefix — alias them (e.g. AS posts_total)
  • Documented row multiplication when joining sibling "many" relations
  • Clarified tested PHP/Laravel versions
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support