apidoc.php 5.8 KB

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