group = $group; $this->route->setGroup($group); return $this; } public function name(string $value): static { if (($groupName = $this->group?->getFullName()) !== null) { $value = $groupName.$value; } $this->router->addNamedRoute($value, $this->route); return $this; } /** @param Middleware|Middleware[] $value */ public function middleware(Middleware|array $value): static { $value = is_array($value) ? $value : [$value]; $this->route->addMiddleware($value); return $this; } public function getRoute(): Route { return $this->route; } }