You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
This discussion was converted from issue #13 on November 25, 2022 07:59.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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