quick icon indicating copy to clipboard operation
quick copied to clipboard

Eager loading polymorphicBelongsTo fails

Open MordantWastrel opened this issue 4 years ago • 0 comments

We have invoice which has a polymorphicBelongsTo entity that is either a child or a user.

The relationship works perfectly unless we try to eager-load the relationship with .with(). It produces a query of users that is looking for childID (the PK of the other entity type).

No trouble if you don't eager load.

MordantWastrel avatar Sep 25 '20 14:09 MordantWastrel