Add zenstruck/messenger-monitor-bundle recipe (#1780)

This commit is contained in:
Kevin Bond
2025-04-22 10:25:20 -04:00
committed by GitHub
parent ed9510620e
commit 666092957f
5 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
zenstruck_messenger_monitor:
storage:
orm:
entity_class: App\Entity\ProcessedMessage

View File

@@ -0,0 +1,9 @@
{
"bundles": {
"Zenstruck\\Messenger\\Monitor\\ZenstruckMessengerMonitorBundle": ["all"]
},
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/",
"src/": "%SRC_DIR%/"
}
}

View File

@@ -0,0 +1,9 @@
* You're almost ready to use zenstruck/messenger-monitor-bundle!
* First, create a migration with <comment>symfony console make:migration</comment>
and run it with <comment>symfony console doctrine:migrations:migrate</comment>.
* Visit <comment>/admin/messenger</comment> as a user with <comment>ROLE_ADMIN</comment>
to see the Dashboard UI.
* <fg=blue>Read</> the documentation at <comment>https://github.com/zenstruck/messenger-monitor-bundle</>

View File

@@ -0,0 +1,13 @@
<?php
namespace App\Controller\Admin;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Zenstruck\Messenger\Monitor\Controller\MessengerMonitorController as BaseMessengerMonitorController;
#[Route('/admin/messenger')]
#[IsGranted('ROLE_ADMIN')]
class MessengerMonitorController extends BaseMessengerMonitorController
{
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Entity;
use Zenstruck\Messenger\Monitor\History\Model\ProcessedMessage as BaseProcessedMessage;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(readOnly: true)]
#[ORM\Table('messenger_processed_messages')]
class ProcessedMessage extends BaseProcessedMessage
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
public function id(): ?int
{
return $this->id;
}
}