feat(user): add changelog read tracking and unread count method

This commit is contained in:
Andras Bacsai
2025-08-07 21:57:00 +02:00
parent e8892b3d29
commit 0e7cc988a6
10 changed files with 887 additions and 110 deletions

View File

@@ -203,6 +203,16 @@ class User extends Authenticatable implements SendsEmail
return $this->belongsToMany(Team::class)->withPivot('role');
}
public function changelogReads()
{
return $this->hasMany(UserChangelogRead::class);
}
public function getUnreadChangelogCount(): int
{
return app(\App\Services\ChangelogService::class)->getUnreadCountForUser($this);
}
public function getRecipients(): array
{
return [$this->email];