Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent Eager Loading #363

Open
ehsan-soleimanian opened this issue Oct 2, 2024 · 1 comment
Open

Prevent Eager Loading #363

ehsan-soleimanian opened this issue Oct 2, 2024 · 1 comment

Comments

@ehsan-soleimanian
Copy link

there is a problem with fetching a specific media with its tag using getMedia() for a specific Model
it attaches all the attached media to the instance of model and it's a heavy loading if we have already attached many media.
how we can preventing this ?

@EriBloo
Copy link
Contributor

EriBloo commented Dec 18, 2024

Hi.
You can load only relevant media first, $this->media inside getMedia will use those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants