public function getSectionInfo() { $tickets = $this->tickets->getTicketsFromSection($this->request->get('section')); $availableCount = count(array_filter($tickets, function ($ticketInfo) { return $ticketInfo['status'] == 'available'; })); $view = new Template('modal_section', compact('tickets')); return $this->json(['html' => $view->fetch(), 'count' => $availableCount]); }
protected function render($template, $data = []) { $view = new Template($template, $data); return new Response($view->fetch()); }