*/ public function indexPayload(): array { return [ 'title' => (string) config('docs.index.title', 'API documentation'), 'description' => (string) config('docs.index.description', ''), 'links' => [ 'swagger_catalog' => $this->urls->docsSwaggerCatalogUrl(), 'merged_openapi_json' => $this->urls->docsSwaggerMergedJsonUrl(), 'docs_spa' => config('docs.client_url'), 'public_bootstrap' => $this->urls->apiDocsPublicBootstrapUrl(), 'admin_bootstrap' => $this->urls->apiDocsAdminBootstrapUrl(), ], ]; } /** * Multi-spec dropdown payload (CI `View\DocsController::swagger` / `swagger_ui` view). * * @return array{specs: list, merged_openapi_url: string} */ public function swaggerSpecsPayload(): array { $specs = []; foreach ((array) config('docs.swagger_specs', []) as $row) { if (! is_array($row)) { continue; } $name = trim((string) ($row['name'] ?? '')); $path = trim((string) ($row['path'] ?? '')); if ($name === '' || $path === '') { continue; } $specs[] = [ 'name' => $name, 'url' => $this->urls->absolutePublicPathUrl($path), ]; } return [ 'specs' => $specs, 'merged_openapi_url' => $this->urls->docsSwaggerMergedJsonUrl(), ]; } }