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

[6.x] Eager Loading Improvements #418

Merged
merged 3 commits into from
Feb 1, 2024
Merged

Conversation

duncanmcclean
Copy link
Member

In Runway v5, we had an eagerLoadingRelations method which was primarily used to determine which relationships should be eager-loaded when querying models.

It'd try to automatically figure out which blueprint fields map to which Eloquent relationships. If you didn't like its magic, you could override it by specifying a with option in your resource config.

As part of my refactoring for Runway v6, I renamed the method to simply eloquentRelationships since that method was being used for "field -> relationship" mappings for things other than eager loading.

I also renamed the config option from with to relationships.

However, looking back at these changes now, it seems like I should have kept the with config option and had a separate option just for the eager-loading of relationships so none of Runway's relationship mappings get messed up when you take control of eager-loading.

Soo.... that's what I've done in this PR. Split out eager loading stuff into its own method & changed the config setting back to with.

References #412.

During my v6 refactoring, I had merged the "eloquent relationship discovery" stuff with the eager loading relationships setting.
@duncanmcclean duncanmcclean merged commit a3a9660 into 6.x Feb 1, 2024
9 checks passed
@duncanmcclean duncanmcclean deleted the fix/eager-loading-setting branch February 1, 2024 10:39
Copy link

github-actions bot commented Feb 1, 2024

Released as part of v6.0.5.

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

Successfully merging this pull request may close these issues.

1 participant