You've already forked Atomcms-edit
27 lines
959 B
PHP
Executable File
27 lines
959 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Models\Game\Player;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|MessengerFriendship select($columns = ['*'])
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|MessengerFriendship where($column, $operator = null, $value = null)
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|MessengerFriendship whereHas($relation, \Closure $callback = null, $operator = '>=', $count = 1)
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|MessengerFriendship inRandomOrder($seed = '')
|
|
*/
|
|
class MessengerFriendship extends Model
|
|
{
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'user_two_id', 'id');
|
|
}
|
|
|
|
public function friend(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'user_one_id', 'id');
|
|
}
|
|
}
|