[WIP] Fix Person
This commit is contained in:
@@ -88,8 +88,18 @@ class Person extends Model
|
||||
return $this->morphOne(File::class, 'fileable')->where('type', 'avatar')->latestOfMany();
|
||||
}
|
||||
|
||||
public function families()
|
||||
{
|
||||
return $this->belongsToMany(Person::class, 'family_relations', 'owner_id', 'person_id')->withPivot(['relation_with_owner']);
|
||||
}
|
||||
|
||||
public function familyOwner()
|
||||
{
|
||||
return $this->hasOne(Family::class, 'person_id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->hasOne(User::class, 'person_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user