29 lines
657 B
PHP
29 lines
657 B
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Util\Broadcaster;
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
use Symfony\Component\Routing\Attribute\Route;
|
|
|
|
final class AlertController extends AbstractController
|
|
{
|
|
public function __construct(
|
|
private readonly Broadcaster $broadcaster,
|
|
) {}
|
|
|
|
#[Route('/alert', name: 'app_alert')]
|
|
public function index(): Response
|
|
{
|
|
$this->broadcaster->alert(
|
|
'Added to queue',
|
|
'This is a testy test!'
|
|
);
|
|
|
|
return $this->json([
|
|
'Success' => 'Published'
|
|
]);
|
|
}
|
|
}
|