Skip to content

Fix eager loading ancestors with scope #586

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

Merged

Conversation

kvas-damian
Copy link
Contributor

Fixes #250

// The first model in the array is always the parent, so add the scope constraints based on that model.
// @link https://github.com/laravel/framework/pull/25240
// @link https://github.com/lazychaser/laravel-nestedset/issues/351
optional($models[0])->applyNestedSetScope($this->query);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was incorrect, when models were from different scopes

@kvas-damian
Copy link
Contributor Author

@lazychaser any chance you can take a look on it?

@lazychaser lazychaser merged commit 38d3bd4 into lazychaser:v6 Nov 29, 2023
@kvas-damian kvas-damian deleted the fix-eagerLoadingAncestorsWithScope branch November 30, 2023 12:20
@kvas-damian
Copy link
Contributor Author

Thanks

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.

Eager loading of ancestors not working when using scope
2 participants