35 lines
590 B
PHP
35 lines
590 B
PHP
<?php
|
|
|
|
namespace App\Models\Traits\UserRelation\Relationships;
|
|
|
|
use App\Models\Relationship;
|
|
use App\Models\User;
|
|
|
|
trait UserRelationRelationships
|
|
{
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function receivedUsers()
|
|
{
|
|
return $this->belongsTo(User::class, 'from_id');
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function relationships()
|
|
{
|
|
return $this->belongsTo(Relationship::class, 'relation_id');
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function sentUsers()
|
|
{
|
|
return $this->belongsTo(User::class, 'to_id');
|
|
}
|
|
}
|