Commit 1fdd186d authored by Taylor Otwell's avatar Taylor Otwell

Merge pull request #1974 from neoascetic/belongs_to_call_a_getter

Access foreign property in Belongs_To through a getter
parents 39654291 641ac8d6
...@@ -110,7 +110,7 @@ class Belongs_To extends Relationship { ...@@ -110,7 +110,7 @@ class Belongs_To extends Relationship {
*/ */
public function foreign_value() public function foreign_value()
{ {
return $this->base->get_attribute($this->foreign); return $this->base->{$this->foreign};
} }
/** /**
...@@ -126,4 +126,4 @@ class Belongs_To extends Relationship { ...@@ -126,4 +126,4 @@ class Belongs_To extends Relationship {
return $this->base; return $this->base;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment