api code global jain
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user