Skip to content

Commit 641ac8d

Browse files
committed
Access foreign property in Belongs_To through a getter
1 parent cffded6 commit 641ac8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

laravel/database/eloquent/relationships/belongs_to.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function match($relationship, &$children, $parents)
110110
*/
111111
public function foreign_value()
112112
{
113-
return $this->base->get_attribute($this->foreign);
113+
return $this->base->{$this->foreign};
114114
}
115115

116116
/**
@@ -126,4 +126,4 @@ public function bind($id)
126126
return $this->base;
127127
}
128128

129-
}
129+
}

0 commit comments

Comments
 (0)