Skip to content

Commit

Permalink
Fix to updating attached To-Many relationships
Browse files Browse the repository at this point in the history
  • Loading branch information
huntie committed Jul 28, 2017
1 parent db83d98 commit 1419a83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Http/Concerns/UpdatesModelRelations.php
Expand Up @@ -114,7 +114,7 @@ protected function updateResourceRelationships($record, array $relationships)
if ($this->getRelationType($name) === 'To-One') {
$record->{$name}()->associate(array_get($relationship, 'data.id'));
$record->save();
} else if ($this->getRelationType($relation) === 'To-Many') {
} else if ($this->getRelationType($name) === 'To-Many') {
$record->{$name}()->sync(array_pluck($relationship['data'], 'id'));
}
}
Expand Down

0 comments on commit 1419a83

Please sign in to comment.