Skip to content

Commit

Permalink
Merge pull request #55 from GuidoHendriks/factory-as-data
Browse files Browse the repository at this point in the history
Use `getKey()` instead of hardcoded `id`
  • Loading branch information
christophrumpel committed Jun 25, 2020
2 parents a585b92 + 73fc727 commit 1139add
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TranslatesFactoryData.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ private function transformFactoriesToRelationIds(array $defaultModelFields): arr
return collect($defaultModelFields)
->map(function ($item) {
if ($this->isFactory($item)) {
return $item->create()->id;
return $item->create()->getKey();
}

return $item;
Expand Down

0 comments on commit 1139add

Please sign in to comment.