mirror of
https://github.com/ambieco/scribe.git
synced 2026-04-30 20:12:21 +08:00
Make generator only fetch response from route if method is GET
This commit is contained in:
@@ -261,7 +261,7 @@ class GenerateDocumentation extends Command
|
||||
foreach ($routes as $route) {
|
||||
if (in_array($route->getName(), $allowedRoutes) || str_is($routePrefix, $generator->getUri($route)) || in_array($middleware, $route->middleware())) {
|
||||
if ($this->isValidRoute($route) && $this->isRouteVisibleForDocumentation($route->getAction()['uses'])) {
|
||||
$parsedRoutes[] = $generator->processRoute($route, $bindings, $this->option('header'), $withResponse);
|
||||
$parsedRoutes[] = $generator->processRoute($route, $bindings, $this->option('header'), $withResponse && in_array('GET', $generator->getMethods($route)));
|
||||
$this->info('Processed route: ['.implode(',', $generator->getMethods($route)).'] '.$generator->getUri($route));
|
||||
} else {
|
||||
$this->warn('Skipping route: ['.implode(',', $generator->getMethods($route)).'] '.$generator->getUri($route));
|
||||
|
||||
Reference in New Issue
Block a user