mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-15 13:32:41 +08:00
topic_reply & hr_reached notification configurable
This commit is contained in:
@@ -102,6 +102,7 @@ class User extends Authenticatable implements FilamentUser, HasName
|
||||
'invites' => '邀请',
|
||||
];
|
||||
|
||||
public static array $notificationOptions = ['topic_reply', 'hr_reached'];
|
||||
|
||||
public function getClassTextAttribute(): string
|
||||
{
|
||||
@@ -555,6 +556,14 @@ class User extends Authenticatable implements FilamentUser, HasName
|
||||
return false;
|
||||
}
|
||||
|
||||
public function acceptNotification($name): bool
|
||||
{
|
||||
if (!isset($this->original['notifs'])) {
|
||||
throw new \RuntimeException("Not fetch field: notifs");
|
||||
}
|
||||
return str_contains($this->notifs, "[{$name}]");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user