Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid committed May 5, 2019
1 parent 3b76570 commit 35f6cc8
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -217,12 +217,12 @@ public function updateExistingPivot($id, array $attributes, $touch = true)
*/
protected function updateExistingPivotUsingCustomClass($id, array $attributes, $touch)
{
$current = $this->getCurrent()
->where($this->foreignPivotKey, $this->parent->{$this->parentKey})
->where($this->relatedPivotKey, $this->parseId($id))
->first();

$updated = $current->fill($attributes)->isDirty();
$updated = $this->getCurrent()
->where($this->foreignPivotKey, $this->parent->{$this->parentKey})
->where($this->relatedPivotKey, $this->parseId($id))
->first()
->fill($attributes)
->isDirty();

$this->newPivot([
$this->foreignPivotKey => $this->parent->{$this->parentKey},
Expand Down

0 comments on commit 35f6cc8

Please sign in to comment.