新版订单消耗系统

api.php 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Standards Tree
  6. |--------------------------------------------------------------------------
  7. |
  8. | Versioning an API with Dingo revolves around content negotiation and
  9. | custom MIME types. A custom type will belong to one of three
  10. | standards trees, the Vendor tree (vnd), the Personal tree
  11. | (prs), and the Unregistered tree (x).
  12. |
  13. | By default the Unregistered tree (x) is used, however, should you wish
  14. | to you can register your type with the IANA. For more details:
  15. | https://tools.ietf.org/html/rfc6838
  16. |
  17. */
  18. 'standardsTree' => env('API_STANDARDS_TREE', 'x'),
  19. /*
  20. |--------------------------------------------------------------------------
  21. | API Subtype
  22. |--------------------------------------------------------------------------
  23. |
  24. | Your subtype will follow the standards tree you use when used in the
  25. | "Accept" header to negotiate the content type and version.
  26. |
  27. | For example: Accept: application/x.SUBTYPE.v1+json
  28. |
  29. */
  30. 'subtype' => env('API_SUBTYPE', ''),
  31. /*
  32. |--------------------------------------------------------------------------
  33. | Default API Version
  34. |--------------------------------------------------------------------------
  35. |
  36. | This is the default version when strict mode is disabled and your API
  37. | is accessed via a web browser. It's also used as the default version
  38. | when generating your APIs documentation.
  39. |
  40. */
  41. 'version' => env('API_VERSION', 'v1'),
  42. /*
  43. |--------------------------------------------------------------------------
  44. | Default API Prefix
  45. |--------------------------------------------------------------------------
  46. |
  47. | A default prefix to use for your API routes so you don't have to
  48. | specify it for each group.
  49. |
  50. */
  51. 'prefix' => env('API_PREFIX', 'api'),
  52. /*
  53. |--------------------------------------------------------------------------
  54. | Default API Domain
  55. |--------------------------------------------------------------------------
  56. |
  57. | A default domain to use for your API routes so you don't have to
  58. | specify it for each group.
  59. |
  60. */
  61. 'domain' => env('API_DOMAIN', null),
  62. /*
  63. |--------------------------------------------------------------------------
  64. | Name
  65. |--------------------------------------------------------------------------
  66. |
  67. | When documenting your API using the API Blueprint syntax you can
  68. | configure a default name to avoid having to manually specify
  69. | one when using the command.
  70. |
  71. */
  72. 'name' => env('API_NAME', null),
  73. /*
  74. |--------------------------------------------------------------------------
  75. | Conditional Requests
  76. |--------------------------------------------------------------------------
  77. |
  78. | Globally enable conditional requests so that an ETag header is added to
  79. | any successful response. Subsequent requests will perform a check and
  80. | will return a 304 Not Modified. This can also be enabled or disabled
  81. | on certain groups or routes.
  82. |
  83. */
  84. 'conditionalRequest' => env('API_CONDITIONAL_REQUEST', true),
  85. /*
  86. |--------------------------------------------------------------------------
  87. | Strict Mode
  88. |--------------------------------------------------------------------------
  89. |
  90. | Enabling strict mode will require clients to send a valid Accept header
  91. | with every request. This also voids the default API version, meaning
  92. | your API will not be browsable via a web browser.
  93. |
  94. */
  95. 'strict' => env('API_STRICT', false),
  96. /*
  97. |--------------------------------------------------------------------------
  98. | Debug Mode
  99. |--------------------------------------------------------------------------
  100. |
  101. | Enabling debug mode will result in error responses caused by thrown
  102. | exceptions to have a "debug" key that will be populated with
  103. | more detailed information on the exception.
  104. |
  105. */
  106. 'debug' => env('API_DEBUG', false),
  107. /*
  108. |--------------------------------------------------------------------------
  109. | Generic Error Format
  110. |--------------------------------------------------------------------------
  111. |
  112. | When some HTTP exceptions are not caught and dealt with the API will
  113. | generate a generic error response in the format provided. Any
  114. | keys that aren't replaced with corresponding values will be
  115. | removed from the final response.
  116. |
  117. */
  118. 'errorFormat' => [
  119. 'message' => ':message',
  120. 'errors' => ':errors',
  121. 'code' => ':code',
  122. 'status_code' => ':status_code',
  123. 'debug' => ':debug',
  124. ],
  125. /*
  126. |--------------------------------------------------------------------------
  127. | API Middleware
  128. |--------------------------------------------------------------------------
  129. |
  130. | Middleware that will be applied globally to all API requests.
  131. |
  132. */
  133. 'middleware' => [
  134. ],
  135. /*
  136. |--------------------------------------------------------------------------
  137. | Authentication Providers
  138. |--------------------------------------------------------------------------
  139. |
  140. | The authentication providers that should be used when attempting to
  141. | authenticate an incoming API request.
  142. |
  143. */
  144. 'auth' => [
  145. ],
  146. /*
  147. |--------------------------------------------------------------------------
  148. | Throttling / Rate Limiting
  149. |--------------------------------------------------------------------------
  150. |
  151. | Consumers of your API can be limited to the amount of requests they can
  152. | make. You can create your own throttles or simply change the default
  153. | throttles.
  154. |
  155. */
  156. 'throttling' => [
  157. ],
  158. /*
  159. |--------------------------------------------------------------------------
  160. | Response Transformer
  161. |--------------------------------------------------------------------------
  162. |
  163. | Responses can be transformed so that they are easier to format. By
  164. | default a Fractal transformer will be used to transform any
  165. | responses prior to formatting. You can easily replace
  166. | this with your own transformer.
  167. |
  168. */
  169. 'transformer' => env('API_TRANSFORMER', Dingo\Api\Transformer\Adapter\Fractal::class),
  170. /*
  171. |--------------------------------------------------------------------------
  172. | Response Formats
  173. |--------------------------------------------------------------------------
  174. |
  175. | Responses can be returned in multiple formats by registering different
  176. | response formatters. You can also customize an existing response
  177. | formatter.
  178. |
  179. */
  180. 'defaultFormat' => env('API_DEFAULT_FORMAT', 'json'),
  181. 'formats' => [
  182. 'json' => Dingo\Api\Http\Response\Format\Json::class,
  183. ],
  184. ];