quick
quick copied to clipboard
Eager loading polymorphicBelongsTo fails
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.