Files
Mangarr/src/Service/NotificationService.php
jerem f7bb7b9148 Added:
- activity on menu
- starting activity page
2024-06-17 22:36:37 +02:00

21 lines
383 B
PHP

<?php
namespace App\Service;
use Symfony\Component\Mercure\HubInterface;
use Symfony\Component\Mercure\Update;
class NotificationService
{
public function __construct(private HubInterface $hub)
{
}
public function sendUpdate(mixed $data): void
{
$update = new Update('notification', json_encode($data));
$this->hub->publish($update);
}
}