Skip to content

Commit

Permalink
Merge pull request #13001 from IsraelOrtuno/patch-1
Browse files Browse the repository at this point in the history
[5.2] Use relation setter when setting relations
  • Loading branch information
taylorotwell committed Apr 3, 2016
2 parents 4000d14 + 8031ca0 commit 341fe49
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -2694,7 +2694,9 @@ protected function getRelationshipFromMethod($method)
.'Illuminate\Database\Eloquent\Relations\Relation');
}

return $this->relations[$method] = $relations->getResults();
$this->setRelation($method, $results = $relations->getResults());

return $results;
}

/**
Expand Down

0 comments on commit 341fe49

Please sign in to comment.