arthem/object-reference-bundle
Doctrine ORM bundle that stores references to any entity as a type and ID pair, using the ObjectReference attribute and lazy closures so relations stay lightweight and framework-agnostic.
Story referencing either an Actor or Director via a single field) without complex joins or discriminator columns. Reduces boilerplate for polymorphic entities in Doctrine.Actor, Guest, AI).Human, ServiceAccount).id/type columns with typed references — reflection inference means existing typed properties can be wired up without annotating each one.id/type columns.laravel-polymorphic-relations or custom traits).Actor or Director attributes in a single query).morphTo in Eloquent) over Doctrine attributes.For Executives: "This package lets us model flexible, type-safe relationships (e.g., a ‘Story’ referencing any ‘ContentCreator’) without bloating our database or writing custom ORM logic. The latest release removes most of the setup work — the library now infers configuration from our existing code — so the cost to trial it on a real feature is a small spike rather than a project. It’s a lightweight alternative to building polymorphic features from scratch, saving dev time while keeping our data architecture clean. Ideal for use cases like dynamic authoring or audit trails where relationships aren’t static."
For Engineers:
*"The ObjectReference attribute simplifies polymorphic associations in Doctrine by:
Upgrade note: 1.1.1 is a patch release, but it changes where configuration comes from (reflection vs. an explicit mapping key). If any existing model relied on the custom key, run a quick regression on those entities before rolling it out.
Tradeoff: Requires Doctrine (not Eloquent) and assumes comfort with closures. Still early-stage and single-maintainer, but the reflection-based setup makes it cheaper than ever to evaluate."*
How can I help you explore Laravel packages today?