Skip to content

Commit 1b0bdb4

Browse files
committed
check if object
1 parent 4311ac0 commit 1b0bdb4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Database/Eloquent/Model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ public function refresh()
11531153

11541154
$this->load(collect($this->relations)->reject(function ($relation) {
11551155
return $relation instanceof Pivot
1156-
|| in_array(AsPivot::class, class_uses_recursive($relation), true);
1156+
|| (is_object($relation) && in_array(AsPivot::class, class_uses_recursive($relation), true));
11571157
})->keys()->all());
11581158

11591159
$this->syncOriginal();

0 commit comments

Comments
 (0)