mirror of
https://github.com/laravel/laravel.git
synced 2025-02-20 11:53:14 +08:00
Access foreign property in Belongs_To through a getter
This commit is contained in:
parent
cffded660c
commit
641ac8d69c
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user