Use belongsTo versus hasOne when more logical.

This commit is contained in:
Dane Everitt
2017-02-05 18:00:39 -05:00
parent 323f1d943f
commit b1389262e2
4 changed files with 16 additions and 16 deletions

View File

@@ -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');
}
}