Accessors ignore eager loads #33831
-
Description:Accessors ignore eager loads (and execute queries separately). Steps To Reproduce:For example, I have the following 1-to-1 relationship between
On
The problem is when you want to display a listing of users:
This will execute as many queries as there are |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This should definitely work. What does the query log look like? Can you reproduce the issue on a fresh Laravel installation? |
Beta Was this translation helpful? Give feedback.
-
My bad, sorry. I got confused with other things not being eagerly loaded (and was thinking that's because of accessor ignoring eager-loads). Sorry! |
Beta Was this translation helpful? Give feedback.
This should definitely work.
What does the query log look like? Can you reproduce the issue on a fresh Laravel installation?