Skip to content

Commit

Permalink
Merge pull request #547 from kohlerdominik/fix-undefined-key-error
Browse files Browse the repository at this point in the history
Fixed Undefined Key error in nested relationship
  • Loading branch information
lazychaser authored Feb 11, 2022
2 parents 7e631db + 67f1867 commit 3fe245b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/BaseRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function addEagerConstraints(array $models)
// 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);
optional(reset($models))->applyNestedSetScope($this->query);

$this->query->whereNested(function (Builder $inner) use ($models) {
// We will use this query in order to apply constraints to the
Expand Down

0 comments on commit 3fe245b

Please sign in to comment.