Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 14, 2020
1 parent 942e2c5 commit 678b26b
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 678b26b

Please sign in to comment.