This commit is contained in:
2026-05-28 20:37:53 +02:00
parent 548100af74
commit 1db50bc69a
18 changed files with 253 additions and 11 deletions
+14
View File
@@ -149,6 +149,20 @@ class User extends Authenticatable implements FilamentUser, HasAvatar, HasLocale
return $this->morphMany(Report::class, 'reportable');
}
public function followers(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
{
return $this->belongsToMany(self::class, 'follows', 'following_id', 'follower_id')
->withPivot('status')
->withTimestamps();
}
public function following(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
{
return $this->belongsToMany(self::class, 'follows', 'follower_id', 'following_id')
->withPivot('status')
->withTimestamps();
}
public function moderationCase(): MorphOne
{
return $this->morphOne(ModerationCase::class, 'caseable');