UserFollowRelation.php
686 Bytes
<?php
namespace App\Models;
use App\Support\Model;
use Awobaz\Compoships\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class UserFollowRelation extends Model
{
use SoftDeletes;
protected $table = 'user_follow_relations';
/**
* @return \Awobaz\Compoships\Database\Eloquent\Relations\BelongsTo
*/
public function following(): BelongsTo
{
return $this->belongsTo(User::class, 'following_id');
}
/**
* @return \Awobaz\Compoships\Database\Eloquent\Relations\BelongsTo
*/
public function follower(): BelongsTo
{
return $this->belongsTo(User::class, 'follower_id');
}
}