Skip to content

Commit

Permalink
Use force fill to populate the default attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
sileence committed Nov 12, 2016
1 parent d81d267 commit e56b33a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Relations/HasOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected function getDefaultFor(Model $model)
if (is_callable($this->withDefault)) {
$result = call_user_func($this->withDefault);
} elseif (is_array($this->withDefault)) {
$result = $this->related->newInstance($this->withDefault);
$result = $this->related->newInstance()->forceFill($this->withDefault);
} elseif ($this->withDefault === true) {
$result = $this->related->newInstance();
}
Expand Down

0 comments on commit e56b33a

Please sign in to comment.