Skip to content

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