Files
Mangarr/src/Service/NotificationService.php
Jérémy Guillot bc85649789 Added:
- Messenger, Mercure
- chapter download flow (lelscan only)
2024-06-13 18:11:11 +02:00

21 lines
390 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(string $topic, mixed $data): void
{
$update = new Update($topic, json_encode($data));
$this->hub->publish($update);
}
}