Skip to content

Commit 25ebd2d

Browse files
Endy-cEndy
and
Endy
authored
fix: error in using console command php artisan api:routes (#19)
Co-authored-by: Endy <[email protected]>
1 parent 31bf026 commit 25ebd2d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Console/Command/Routes.php

+2
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ protected function getRoutes()
9898
foreach ($collection->getRoutes() as $route) {
9999
$routes[] = $this->filterRoute([
100100
'host' => $route->domain(),
101+
'domain' => $route->domain(),
102+
'middleware' => json_encode($route->middleware()),
101103
'method' => implode('|', $route->methods()),
102104
'uri' => $route->uri(),
103105
'name' => $route->getName(),

src/Routing/Router.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ public function getRoutes($version = null)
690690
}
691691
}
692692

693-
return is_null($version) ? $collections : $collections[$version];
693+
return is_null($version) ? collect($collections) : $collections[$version];
694694
}
695695

696696
/**

0 commit comments

Comments
 (0)