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
I have a list of posts that i load with eloquent from database. Each post have an author that i eager load. In the server response is only the users id. No image. As i take a look in the Debugbar i can see many of db selects for each users image triggered by InteractsWithMedia.
Is there any magic automatic model hydration that does this?
Can i disable that?
This is the users model attribute mutator that gets called... but i never call it in the controller.
The media-library registrations:
Its the very same thing as i return the response with a laravel jsonresponse class or directly the eloquent collection. With or without eager loading users.
I need to just load all authors of posts without media. Only the users ids are required for the client. But media is always loaded.
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there 👋,
I have a list of posts that i load with eloquent from database. Each post have an author that i eager load. In the server response is only the users id. No image. As i take a look in the Debugbar i can see many of db selects for each users image triggered by InteractsWithMedia.
Is there any magic automatic model hydration that does this?
Can i disable that?
This is the users model attribute mutator that gets called... but i never call it in the controller.
The media-library registrations:
Its the very same thing as i return the response with a laravel jsonresponse class or directly the eloquent collection. With or without eager loading users.
I need to just load all authors of posts without media. Only the users ids are required for the client. But media is always loaded.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions