Skip to content

Commit

Permalink
Detach if value is null
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Thompson committed Dec 12, 2015
1 parent 76e153f commit 8518879
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/FilesFieldTypeAccessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public function set($value)
if ($value instanceof Collection) {
$this->fieldType->getRelation()->sync($this->organizeSyncValue($value->filter()->all()));
}

if (!$value) {
$this->fieldType->getRelation()->detach();
}
}

/**
Expand Down

0 comments on commit 8518879

Please sign in to comment.