We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7e631db + 67f1867 commit 3fe245bCopy full SHA for 3fe245b
src/BaseRelation.php
@@ -158,7 +158,7 @@ public function addEagerConstraints(array $models)
158
// The first model in the array is always the parent, so add the scope constraints based on that model.
159
// @link https://github.com/laravel/framework/pull/25240
160
// @link https://github.com/lazychaser/laravel-nestedset/issues/351
161
- optional($models[0])->applyNestedSetScope($this->query);
+ optional(reset($models))->applyNestedSetScope($this->query);
162
163
$this->query->whereNested(function (Builder $inner) use ($models) {
164
// We will use this query in order to apply constraints to the
0 commit comments