Skip to content

Commit

Permalink
check if object
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Apr 21, 2020
1 parent 4311ac0 commit 1b0bdb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ public function refresh()

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

$this->syncOriginal();
Expand Down

0 comments on commit 1b0bdb4

Please sign in to comment.