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
|
@ -220,11 +220,11 @@ class Node extends Model
|
|||
/**
|
||||
* Gets the location associated with a node.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function location()
|
||||
{
|
||||
return $this->hasOne(Location::class, 'id', 'location_id');
|
||||
return $this->belongsTo(Location::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Reference in a new issue