Use belongsTo versus hasOne when more logical.
This commit is contained in:
parent
323f1d943f
commit
b1389262e2
4 changed files with 16 additions and 16 deletions
|
@ -63,10 +63,10 @@ class DatabaseServer extends Model
|
|||
/**
|
||||
* Gets the node associated with a database host.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function node()
|
||||
{
|
||||
return $this->hasOne(Node::class, 'id', 'linked_node');
|
||||
return $this->belongsTo(Node::class, 'linked_node');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue