public function __invoke(AdminControllerEvent $event) { $ordersCount = $this->orders->count(); $draftsCount = $this->drafts->count(); $data = ['Orders' => $ordersCount, 'Invoice address drafts' => $draftsCount]; $event->addViewVariables('orders', ['data' => $data], -1); }