Browse Source

Access foreign property in Belongs_To through a getter

Pavel Puchkin 11 years ago
parent
commit
641ac8d69c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      laravel/database/eloquent/relationships/belongs_to.php

+ 2 - 2
laravel/database/eloquent/relationships/belongs_to.php

@@ -110,7 +110,7 @@ class Belongs_To extends Relationship {
 	 */
 	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 {
 		return $this->base;
 	}
 
-}
+}