Skip to content

Commit ec8e1d7

Browse files
committed
https://github.com/lazychaser/laravel-nestedset/pull/552
1 parent f47602e commit ec8e1d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/BaseRelation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function addEagerConstraints(array $models)
144144
// The first model in the array is always the parent, so add the scope constraints based on that model.
145145
// @link https://github.com/laravel/framework/pull/25240
146146
// @link https://github.com/lazychaser/laravel-nestedset/issues/351
147-
optional($models[0])->applyNestedSetScope($this->query);
147+
optional(reset($models))->applyNestedSetScope($this->query);
148148

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

0 commit comments

Comments
 (0)