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

This commit is contained in:
Andras Bacsai committed 2025-08-12 10:06:19 +02:00
1 parent e8892b3d29
commit 0e7cc988a6
10 files changed
+887 -110

No files matched your search

+10
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];