Skip to content
Permalink
Browse files

formatting

  • Loading branch information
taylorotwell committed Jan 14, 2020
1 parent 942e2c5 commit 678b26b1a9cd0d8a6bef85932420e67a1b20e677
Showing with 12 additions and 7 deletions.
  1. +12 −7 src/Illuminate/Database/Eloquent/Model.php
@@ -1150,14 +1150,19 @@ public function refresh()
static::newQueryWithoutScopes()->findOrFail($this->getKey())->attributes
);

$actualRelations = collect();
foreach ($this->relations as $key => $relation) {
if (! ($relation instanceof Pivot)) {
$actualRelations->put($key, $relation);
}
}
// $actualRelations = collect();

// foreach ($this->relations as $key => $relation) {
// if (! ($relation instanceof Pivot)) {
// $actualRelations->put($key, $relation);
// }
// }

$this->load(collect($this->relations)->reject(function ($relation) {
return $relation instanceof Pivot;
})->keys()->all());

$this->load($actualRelations->keys()->toArray());
// $this->load($actualRelations->keys()->toArray());

$this->syncOriginal();

0 comments on commit 678b26b

Please sign in to comment.
You can’t perform that action at this time.