catch.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CatchAdmin
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 https://catchadmin.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( https://github.com/JaguarJack/catchadmin/blob/master/LICENSE.md )
  8. // +----------------------------------------------------------------------
  9. // | Author: JaguarJack [ njphper@gmail.com ]
  10. // +----------------------------------------------------------------------
  11. return [
  12. /*
  13. |--------------------------------------------------------------------------
  14. | catch-admin default middleware
  15. |--------------------------------------------------------------------------
  16. |
  17. | where you can set default middlewares
  18. |
  19. */
  20. 'middleware_group' => [
  21. ],
  22. /*
  23. |--------------------------------------------------------------------------
  24. | catch-admin catch_auth_middleware_alias
  25. |--------------------------------------------------------------------------
  26. |
  27. | where you can set default middlewares
  28. |
  29. */
  30. 'catch_auth_middleware_alias' => [
  31. ],
  32. /*
  33. |--------------------------------------------------------------------------
  34. | catch-admin super admin id
  35. |--------------------------------------------------------------------------
  36. |
  37. | where you can set super admin id
  38. |
  39. */
  40. 'super_admin' => 1,
  41. 'request_allowed' => true,
  42. /*
  43. |--------------------------------------------------------------------------
  44. | catch-admin module setting
  45. |--------------------------------------------------------------------------
  46. |
  47. | the root where module generate
  48. | the namespace is module root namespace
  49. | the default dirs is module generate default dirs
  50. */
  51. 'module' => [
  52. 'root' => 'modules',
  53. 'namespace' => 'Modules',
  54. 'default' => ['develop', 'user', 'common'],
  55. 'default_dirs' => [
  56. 'Http'.DIRECTORY_SEPARATOR,
  57. 'Http'.DIRECTORY_SEPARATOR.'Requests'.DIRECTORY_SEPARATOR,
  58. 'Http'.DIRECTORY_SEPARATOR.'Controllers'.DIRECTORY_SEPARATOR,
  59. 'Models'.DIRECTORY_SEPARATOR,
  60. 'views'.DIRECTORY_SEPARATOR,
  61. ],
  62. // storage module information
  63. // which driver should be used?
  64. 'driver' => [
  65. // currently, catchadmin support file and database
  66. // the default is driver
  67. 'default' => 'file',
  68. // use database driver
  69. 'table_name' => 'admin_modules'
  70. ],
  71. /**
  72. * module routes collection
  73. *
  74. */
  75. 'routes' => [],
  76. ],
  77. /*
  78. |--------------------------------------------------------------------------
  79. | catch-admin response
  80. |--------------------------------------------------------------------------
  81. */
  82. 'response' => [
  83. // it's a controller middleware, it's set in CatchController
  84. // if you not need json response, don't extend CatchController
  85. 'always_json' => \Catch\Middleware\JsonResponseMiddleware::class,
  86. // response listener
  87. // it listens [RequestHandled] event, if you don't need this
  88. // you can change this config
  89. 'request_handled_listener' => \Catch\Listeners\RequestHandledListener::class
  90. ],
  91. /*
  92. |--------------------------------------------------------------------------
  93. | database sql log
  94. |--------------------------------------------------------------------------
  95. */
  96. 'listen_db_log' => true,
  97. /*
  98. |--------------------------------------------------------------------------
  99. | admin auth model
  100. |--------------------------------------------------------------------------
  101. */
  102. 'auth_model' => \Modules\User\Models\User::class,
  103. /*
  104. |--------------------------------------------------------------------------
  105. | route config
  106. |--------------------------------------------------------------------------
  107. */
  108. 'route' => [
  109. 'prefix' => 'api',
  110. 'middlewares' => [
  111. \Catch\Middleware\AuthMiddleware::class,
  112. \Catch\Middleware\JsonResponseMiddleware::class
  113. ],
  114. // 'cache_path' => base_path('bootstrap/cache') . DIRECTORY_SEPARATOR . 'admin_route_cache.php'
  115. ],
  116. ];