Hi everyone, I'm trying to eager load some relatio...
# exposed
g
Hi everyone, I'm trying to eager load some relations using
.with(Entity::relation
, but when said relation is accessed, outside of the transaction it was fetched from, I get
Can't init value outside the transaction
. My understanding was that using
With
would load all relations eagerly, is that wrong?
l
You can’t load eagerly outside of transaction
Copy code
NOTE: References that are eagerly loaded are stored inside the Transaction Cache, this means that they are not available in other transactions and thus must be loaded and referenced inside the same transaction.
g
Oh damn... I missed that. Thanks!
🙂 1
393 Views