Eloquent model retrieved event triggered before relations retrieval #33003
Unanswered
AntoineDewaele
asked this question in
General
Replies: 1 comment
-
in Eloquent Builder
This function seems to be called also for the relations. So the retrieved event should be triggered for each of the related models, on the hydrate method. That is why it is not cought on the resource model. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I would like to create a Trait that override
retrieved
model event to handle with a eager loaded relation.However, it seems that
retrieved
event is fired before relation are loaded because this relation call execute another request to get the relation.After some research, i find a discussion about it : #29658 but i cannot find any follow-up or any way to get around this issue.
Is there any event that is fired after relation are eager loaded or any way to work around ?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions