Replies: 1 comment
-
Why not just run your query using |
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.
-
First of all sorry for opening an issue, but Discussions is not enabled 😅
Let's pretend we have defined a
receivedMail
flag for ourUser
model (not the best real world example, I know).User::find(1)->flag('receivedMail');
// trueUser::find(2)->flag('receivedMail');
// trueUser::find(3)->flag('receivedMail');
// false...and so on.
How can I retrieve (for example) all Users along with their flag status, without running n+1 queries?
Example use case: an administration panel that lists users and shows their
receivedMail
status.Thank you
Beta Was this translation helpful? Give feedback.
All reactions