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
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
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');
}
}