We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e631db commit 67f1867Copy full SHA for 67f1867
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