/** * Add route group * * @param array $data Data * * @return $this * @throws \InvalidArgumentException */ public function addGroup(array $data) { if (!isset($data['routes'])) { throw new \InvalidArgumentException('Route group has no routes specified.'); } $group = new Group(); $config = new Config($data); $config->inject($group); $routes = $group->getRoutes(); $this->addRoutes($routes); return $this; }