web push notifications
linter / quality (push) Failing after 1m5s
tests / ci (8.3) (push) Failing after 48s
tests / ci (8.4) (push) Failing after 1m3s
tests / ci (8.5) (push) Failing after 1m2s

This commit is contained in:
Daan Meijer
2026-06-21 23:17:33 +02:00
parent 1e0782385b
commit 98dc8659ba
15 changed files with 646 additions and 16 deletions
+19
View File
@@ -11,6 +11,8 @@ use App\Models\ReadCursor;
use Illuminate\Support\Carbon;
use Illuminate\Support\Str;
use App\Notifications\NewActivityNotification;
class ActivityService
{
/**
@@ -54,6 +56,8 @@ class ActivityService
'subject_type' => $subject ? get_class($subject) : null,
]);
$this->notify($message);
return $message;
}
@@ -70,6 +74,21 @@ class ActivityService
return $mutation;
}
public function notify(Message $message)
{
$dynamic = $message->chat->chatable;
if ($dynamic instanceof Dynamic) {
$participants = $dynamic->participants;
foreach ($participants as $participant) {
if ($message->user_id !== $participant->id) {
$participant->notify(new NewActivityNotification($message));
}
}
}
}
/**
* Retrieve all activities for a given entity.
*/