Skip to content

Commit ffb02ec

Browse files
committed
Add route method to uniqueness filter so we don't filter out routes with the same URI but a different method
1 parent 760d490 commit ffb02ec

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Docs/DocsGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function getRouteDocumentation() {
3030
return collect($this->router->getRoutes())->map(function (Route $route) {
3131
return new RouteDocumentation($route);
3232
})->unique(function (RouteDocumentation $r) {
33-
return $r->getUri();
33+
return $r->getKey();
3434
})->filter(function (RouteDocumentation $r) {
3535
return $r->applyFilter(config('jot.prefix'));
3636
});

src/Docs/RouteDocumentation.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ private function processParameters(Route $r, DocBlock $block) {
131131
$this->params = $params;
132132
}
133133

134+
public function getKey() {
135+
return $this->method . '-' . $this->uri;
136+
}
137+
134138
public function getMethod() {
135139
return $this->method;
136140
}

0 commit comments

Comments
 (0)