<?php
namespace App\Controller\Panel;
use Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpStamp;
use App\Message\SmsNotification;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Routing\Annotation\Route;
class DashboardController extends SharedController
{
/**
* @Route("/%panel_path%/", name="panel.dashboard.index")
* @Security("is_granted('ROLE_PANEL')")
*/
public function index(MessageBusInterface $bus) {
if (!$this->permissions->Dashboard->read) { return $this->breach_of_authority(); exit; }
$this->my_session->set('active_page','panel.dashboard.index');
$this->my_session->set('active_page_title','Dashboard');
//$bus->dispatch(new SmsNotification('Look! I created a message!'));
$attributes = [];
$bus->dispatch(new SmsNotification('Look! I created a message!'), [
new AmqpStamp('custom-routing-key', 0, $attributes),
]);
return $this->shared_render('dashboard/index');
}
}