We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4311ac0 commit 1b0bdb4Copy full SHA for 1b0bdb4
src/Illuminate/Database/Eloquent/Model.php
@@ -1153,7 +1153,7 @@ public function refresh()
1153
1154
$this->load(collect($this->relations)->reject(function ($relation) {
1155
return $relation instanceof Pivot
1156
- || in_array(AsPivot::class, class_uses_recursive($relation), true);
+ || (is_object($relation) && in_array(AsPivot::class, class_uses_recursive($relation), true));
1157
})->keys()->all());
1158
1159
$this->syncOriginal();
0 commit comments