summaryrefslogtreecommitdiff
path: root/app/Api/ApiDocsGenerator.php
diff options
context:
space:
mode:
authorDan Brown2026-04-14 12:22:56 +0100
committerGitHub2026-04-14 12:22:56 +0100
commit0760e677b25d96306b2d1a732c0f92d83ac41ac0 (patch)
tree4972305193c1f3e52e2ee81cf63030b71b4b9731 /app/Api/ApiDocsGenerator.php
parent93f84a81b28ada7467e66d240182a71e5d60278f (diff)
parent208629ee1fce280c31f9baf30a6ed79c3cd17df0 (diff)
Merge pull request #6095 from BookStackApp/tags_apiHEADdevelopment
API: New tag endpoints
Diffstat (limited to 'app/Api/ApiDocsGenerator.php')
-rw-r--r--app/Api/ApiDocsGenerator.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/Api/ApiDocsGenerator.php b/app/Api/ApiDocsGenerator.php
index a59cb8198..53cb2890a 100644
--- a/app/Api/ApiDocsGenerator.php
+++ b/app/Api/ApiDocsGenerator.php
@@ -195,11 +195,12 @@ class ApiDocsGenerator
protected function getFlatApiRoutes(): Collection
{
return collect(Route::getRoutes()->getRoutes())->filter(function ($route) {
- return strpos($route->uri, 'api/') === 0;
+ return str_starts_with($route->uri, 'api/');
})->map(function ($route) {
[$controller, $controllerMethod] = explode('@', $route->action['uses']);
$baseModelName = explode('.', explode('/', $route->uri)[1])[0];
- $shortName = $baseModelName . '-' . $controllerMethod;
+ $controllerMethodKebab = Str::kebab($controllerMethod);
+ $shortName = $baseModelName . '-' . $controllerMethodKebab;
return [
'name' => $shortName,
@@ -207,7 +208,7 @@ class ApiDocsGenerator
'method' => $route->methods[0],
'controller' => $controller,
'controller_method' => $controllerMethod,
- 'controller_method_kebab' => Str::kebab($controllerMethod),
+ 'controller_method_kebab' => $controllerMethodKebab,
'base_model' => $baseModelName,
];
});