apidoc.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <?php
  2. return [
  3. /*
  4. * The output path for the generated documentation.
  5. */
  6. 'output' => 'public/docs',
  7. /*
  8. * The router to be used (Laravel or Dingo).
  9. */
  10. 'router' => 'laravel',
  11. /*
  12. * Generate a Postman collection in addition to HTML docs.
  13. */
  14. 'postman' => true,
  15. /**
  16. * Fractal Transformer Config
  17. *
  18. * must install
  19. * composer require league/fractal
  20. *
  21. * Available serializers:
  22. * -League\Fractal\Serializer\ArraySerializer::class
  23. * -League\Fractal\Serializer\DataArraySerializer::class
  24. * -League\Fractal\Serializer\JsonApiSerializer::class
  25. *
  26. * null means no serializer
  27. */
  28. 'fractal' => [
  29. 'serializer' => null,
  30. ],
  31. /*
  32. * The routes for which documentation should be generated.
  33. * Each group contains rules defining which routes should be included ('match', 'include' and 'exclude' sections)
  34. * and rules which should be applied to them ('apply' section).
  35. */
  36. 'routes' => [
  37. [
  38. /*
  39. * Specify conditions to determine what routes will be parsed in this group.
  40. * A route must fulfill ALL conditions to pass.
  41. */
  42. 'match' => [
  43. /*
  44. * Match only routes whose domains match this pattern (use * as a wildcard to match any characters).
  45. */
  46. 'domains' => [
  47. '*',
  48. // 'domain1.*',
  49. ],
  50. /*
  51. * Match only routes whose paths match this pattern (use * as a wildcard to match any characters).
  52. */
  53. 'prefixes' => [
  54. '*',
  55. // 'users/*',
  56. ],
  57. /*
  58. * Match only routes registered under this version. This option is ignored for Laravel router.
  59. * Note that wildcards are not supported.
  60. */
  61. 'versions' => [
  62. 'v1',
  63. ],
  64. ],
  65. /*
  66. * Include these routes when generating documentation,
  67. * even if they did not match the rules above.
  68. * Note that the route must be referenced by name here (wildcards are supported).
  69. */
  70. 'include' => [
  71. // 'users.index', 'healthcheck*'
  72. ],
  73. /*
  74. * Exclude these routes when generating documentation,
  75. * even if they matched the rules above.
  76. * Note that the route must be referenced by name here (wildcards are supported).
  77. */
  78. 'exclude' => [
  79. // 'users.create', 'admin.*'
  80. ],
  81. /*
  82. * Specify rules to be applied to all the routes in this group when generating documentation
  83. */
  84. 'apply' => [
  85. /*
  86. * Specify headers to be added to the example requests
  87. */
  88. 'headers' => [
  89. // 'Authorization' => 'Bearer {token}',
  90. // 'Api-Version' => 'v2',
  91. ],
  92. /*
  93. * If no @response or @transformer declarations are found for the route,
  94. * we'll try to get a sample response by attempting an API call.
  95. * Configure the settings for the API call here,
  96. */
  97. 'response_calls' => [
  98. /*
  99. * API calls will be made only for routes in this group matching these HTTP methods (GET, POST, etc).
  100. * List the methods here or use '*' to mean all methods. Leave empty to disable API calls.
  101. */
  102. 'methods' => ['GET'],
  103. /*
  104. * For URLs which have parameters (/users/{user}, /orders/{id?}),
  105. * specify what values the parameters should be replaced with.
  106. * Note that you must specify the full parameter, including curly brackets and question marks if any.
  107. */
  108. 'bindings' => [
  109. // '{user}' => 1
  110. ],
  111. /*
  112. * Environment variables which should be set for the API call.
  113. * This is a good place to ensure that notifications, emails
  114. * and other external services are not triggered during the documentation API calls
  115. */
  116. 'env' => [
  117. 'APP_ENV' => 'documentation',
  118. 'APP_DEBUG' => false,
  119. // 'env_var' => 'value',
  120. ],
  121. /*
  122. * Headers which should be sent with the API call.
  123. */
  124. 'headers' => [
  125. 'Content-Type' => 'application/json',
  126. 'Accept' => 'application/json',
  127. // 'key' => 'value',
  128. ],
  129. /*
  130. * Query parameters which should be sent with the API call.
  131. */
  132. 'query' => [
  133. // 'key' => 'value',
  134. ],
  135. /*
  136. * Body parameters which should be sent with the API call.
  137. */
  138. 'body' => [
  139. // 'key' => 'value',
  140. ],
  141. ],
  142. ],
  143. ],
  144. ],
  145. /*
  146. * Custom logo path. Will be copied during generate command. Set this to false to use the default logo.
  147. *
  148. * Change to an absolute path to use your custom logo. For example:
  149. * 'logo' => resource_path('views') . '/api/logo.png'
  150. *
  151. * If you want to use this, please be aware of the following rules:
  152. * - size: 230 x 52
  153. */
  154. 'logo' => false,
  155. ];