123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <?php
- use Knuckles\Scribe\Extracting\Strategies;
- return [
- 'title' => 'Owl Admin API Documentation',
- 'description' => 'Owl Admin API 接口文档',
- 'base_url' => null,
- 'routes' => [
- [
- 'match' => [
- 'prefixes' => ['api/*', 'admin/*'],
- 'domains' => ['*'],
- 'versions' => ['v1'],
- ],
- 'include' => [],
- 'exclude' => [],
- ],
- ],
- 'type' => 'static',
- 'theme' => 'default',
- 'static' => [
- 'output_path' => 'public/docs',
- ],
- 'laravel' => [
- 'add_routes' => true,
- 'docs_url' => '/docs',
- 'middleware' => [],
- // Directory within `public` in which to store CSS and JS assets.
- // By default, assets are stored in `public/vendor/scribe`.
- // If set, assets will be stored in `public/{{assets_directory}}`
- 'assets_directory' => null,
- ],
- 'try_it_out' => [
- 'enabled' => true,
- 'base_url' => null,
- 'use_csrf' => false,
- 'csrf_url' => '/sanctum/csrf-cookie',
- ],
- 'auth' => [
- 'enabled' => true,
- 'default' => true,
- 'in' => 'bearer',
- 'name' => 'token',
- 'use_value' => env('SCRIBE_AUTH_KEY'),
- 'placeholder' => env('YOUR_AUTH_KEY'),
- 'extra_info' => 'You can retrieve your token by visiting your dashboard and clicking <b>Generate API token</b>.',
- ],
- 'intro_text' => <<<'INTRO'
- 欢迎使用 Owl Admin API 接口文档。
- 该文档提供了所有可用的API接口信息。
- INTRO,
- 'example_languages' => [
- 'javascript',
- 'bash',
- ],
- 'examples' => [
- 'faker_seed' => null,
- 'models_source' => ['factoryCreate', 'factoryMake', 'databaseFirst'],
- ],
- 'strategies' => [
- 'metadata' => [
- Strategies\Metadata\GetFromDocBlocks::class,
- Strategies\Metadata\GetFromMetadataAttributes::class,
- ],
- 'urlParameters' => [
- Strategies\UrlParameters\GetFromLaravelAPI::class,
- Strategies\UrlParameters\GetFromUrlParamAttribute::class,
- Strategies\UrlParameters\GetFromUrlParamTag::class,
- ],
- 'queryParameters' => [
- Strategies\QueryParameters\GetFromFormRequest::class,
- Strategies\QueryParameters\GetFromInlineValidator::class,
- Strategies\QueryParameters\GetFromQueryParamAttribute::class,
- Strategies\QueryParameters\GetFromQueryParamTag::class,
- ],
- 'headers' => [
- Strategies\Headers\GetFromRouteRules::class,
- Strategies\Headers\GetFromHeaderAttribute::class,
- Strategies\Headers\GetFromHeaderTag::class,
- ],
- 'bodyParameters' => [
- Strategies\BodyParameters\GetFromFormRequest::class,
- Strategies\BodyParameters\GetFromInlineValidator::class,
- Strategies\BodyParameters\GetFromBodyParamAttribute::class,
- Strategies\BodyParameters\GetFromBodyParamTag::class,
- ],
- 'responses' => [
- Strategies\Responses\UseResponseAttributes::class,
- Strategies\Responses\UseTransformerTags::class,
- Strategies\Responses\UseResponseTag::class,
- Strategies\Responses\UseResponseFileTag::class,
- Strategies\Responses\UseApiResourceTags::class,
- Strategies\Responses\ResponseCalls::class,
- ],
- 'responseFields' => [
- Strategies\ResponseFields\GetFromResponseFieldAttribute::class,
- Strategies\ResponseFields\GetFromResponseFieldTag::class,
- ],
- ],
- 'routeMatcher' => \Knuckles\Scribe\Matching\RouteMatcher::class,
- 'database_connections_to_transact' => [config('database.default')],
- 'external' => ['html_attributes' => []],
- // Generate a Postman collection (v2.1.0) in addition to HTML docs.
- // For 'static' docs, the collection will be generated to public/docs/collection.json.
- // For 'laravel' docs, it will be generated to storage/app/scribe/collection.json.
- // Setting `laravel.add_routes` to true (above) will also add a route for the collection.
- 'postman' => ['enabled' => true, 'overrides' => [
- 'info.version' => '2.0.0',
- ]],
- // Generate an OpenAPI spec (v3.0.1) in addition to docs webpage.
- // For 'static' docs, the collection will be generated to public/docs/openapi.yaml.
- // For 'laravel' docs, it will be generated to storage/app/scribe/openapi.yaml.
- // Setting `laravel.add_routes` to true (above) will also add a route for the spec.
- 'openapi' => ['enabled' => true, 'overrides' => []],
- // Custom logo path. This will be used as the value of the src attribute for the <img> tag,
- // so make sure it points to an accessible URL or path. Set to false to not use a logo.
- // For example, if your logo is in public/img:
- // - 'logo' => '../img/logo.png' // for `static` type (output folder is public/docs)
- // - 'logo' => 'img/logo.png' // for `laravel` type
- 'logo' => false,
- // Customize the "Last updated" value displayed in the docs by specifying tokens and formats.
- // Examples:
- // - {date:F j Y} => March 28, 2022
- // - {git:short} => Short hash of the last Git commit
- // Available tokens are `{date:<format>}` and `{git:<format>}`.
- // The format you pass to `date` will be passed to PHP's `date()` function.
- // The format you pass to `git` can be either "short" or "long".
- 'last_updated' => '{date:F j Y}',
- 'fractal' => [
- // If you are using a custom serializer with league/fractal, you can specify it here.
- 'serializer' => null,
- ],
- // 添加以下配置以确保目录树可以展开
- 'groups' => [
- 'enabled' => true,
- 'sort' => 'asc',
- ],
- 'external' => [
- 'html_attributes' => [
- 'dark-mode' => false,
- ],
- ],
- ];
|