Added:
- Messenger, Mercure - chapter download flow (lelscan only)
This commit is contained in:
20
src/Service/NotificationService.php
Normal file
20
src/Service/NotificationService.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user