26 lines
400 B
PHP
26 lines
400 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models\Traits\Request\Relationships;
|
||
|
|
|
||
|
|
use App\Models\User;
|
||
|
|
|
||
|
|
trait RequestRelationships
|
||
|
|
{
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return mixed
|
||
|
|
*/
|
||
|
|
public function receivedUsers()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class, 'sender_id');
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return mixed
|
||
|
|
*/
|
||
|
|
public function sentUsers()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class, 'receiver_id');
|
||
|
|
}
|
||
|
|
}
|