Skip to content

Commit

Permalink
Access foreign property in Belongs_To through a getter
Browse files Browse the repository at this point in the history
  • Loading branch information
neoascetic committed May 8, 2013
1 parent cffded6 commit 641ac8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions laravel/database/eloquent/relationships/belongs_to.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function match($relationship, &$children, $parents)
*/
public function foreign_value()
{
return $this->base->get_attribute($this->foreign);
return $this->base->{$this->foreign};
}

/**
Expand All @@ -126,4 +126,4 @@ public function bind($id)
return $this->base;
}

}
}

0 comments on commit 641ac8d

Please sign in to comment.