apidoc.php 6.1 KB

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