database.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | PDO Fetch Style
  6. |--------------------------------------------------------------------------
  7. |
  8. | By default, database results will be returned as instances of the PHP
  9. | stdClass object; however, you may desire to retrieve records in an
  10. | array format for simplicity. Here you can tweak the fetch style.
  11. |
  12. */
  13. 'fetch' => PDO::FETCH_CLASS,
  14. /*
  15. |--------------------------------------------------------------------------
  16. | Default Database Connection Name
  17. |--------------------------------------------------------------------------
  18. |
  19. | Here you may specify which of the database connections below you wish
  20. | to use as your default connection for all database work. Of course
  21. | you may use many connections at once using the Database library.
  22. |
  23. */
  24. 'default' => env('DB_CONNECTION', 'mysql'),
  25. /*
  26. |--------------------------------------------------------------------------
  27. | Database Connections
  28. |--------------------------------------------------------------------------
  29. |
  30. | Here are each of the database connections setup for your application.
  31. | Of course, examples of configuring each database platform that is
  32. | supported by Laravel is shown below to make development simple.
  33. |
  34. |
  35. | All database work in Laravel is done through the PHP PDO facilities
  36. | so make sure you have the driver for your particular database of
  37. | choice installed on your machine before you begin development.
  38. |
  39. */
  40. 'connections' => [
  41. 'sqlite' => [
  42. 'driver' => 'sqlite',
  43. 'database' => database_path('database.sqlite'),
  44. 'prefix' => '',
  45. ],
  46. 'mysql' => [
  47. 'driver' => 'mysql',
  48. 'host' => env('WX_DB_HOST', 'localhost'),
  49. 'database' => env('WX_DB_DATABASE', 'forge'),
  50. 'username' => env('WX_DB_USERNAME', 'forge'),
  51. 'password' => env('WX_DB_PASSWORD', ''),
  52. 'charset' => 'utf8',
  53. 'collation' => 'utf8_unicode_ci',
  54. 'prefix' => '',
  55. 'strict' => false,
  56. ],
  57. 'api_mysql' => [
  58. 'driver' => 'mysql',
  59. 'read' => [
  60. 'host' => env('API_DB_READ_HOST','localhost'),
  61. ],
  62. 'write' => [
  63. 'host' => env('API_DB_WRITE_HOST','localhost'),
  64. ],
  65. 'database' => env('API_DB_DATABASE', 'forge'),
  66. 'username' => env('API_DB_USERNAME', 'forge'),
  67. 'password' => env('API_DB_PASSWORD', ''),
  68. 'charset' => 'utf8',
  69. 'collation' => 'utf8_unicode_ci',
  70. 'prefix' => '',
  71. 'strict' => false,
  72. ],
  73. 'command_mysql' => [
  74. 'driver' => 'mysql',
  75. 'read' => [
  76. 'host' => env('API_DB_READ_HOST','localhost'),
  77. ],
  78. 'write' => [
  79. 'host' => env('API_DB_WRITE_HOST','localhost'),
  80. ],
  81. 'database' => env('API_DB_DATABASE', 'forge'),
  82. 'username' => env('API_DB_USERNAME', 'forge'),
  83. 'password' => env('API_DB_PASSWORD', ''),
  84. 'charset' => 'utf8mb4',
  85. 'collation' => 'utf8mb4_unicode_ci',
  86. 'prefix' => '',
  87. 'strict' => false,
  88. ],
  89. 'wangdu_user' => [
  90. 'driver' => 'mysql',
  91. 'host' => env('ZU_DB_HOST', 'localhost'),
  92. 'database' => env('ZU_DB_DATABASE', 'forge'),
  93. 'username' => env('ZU_DB_USERNAME', 'forge'),
  94. 'password' => env('ZU_DB_PASSWORD', ''),
  95. 'charset' => 'utf8mb4',
  96. 'collation' => 'utf8mb4_unicode_ci',
  97. 'prefix' => '',
  98. 'strict' => false,
  99. ],
  100. 'pgsql' => [
  101. 'driver' => 'pgsql',
  102. 'host' => env('DB_HOST', 'localhost'),
  103. 'port' => env('DB_PORT', 5432),
  104. 'database' => env('DB_DATABASE', 'forge'),
  105. 'username' => env('DB_USERNAME', 'forge'),
  106. 'password' => env('DB_PASSWORD', ''),
  107. 'charset' => 'utf8',
  108. 'prefix' => '',
  109. 'schema' => 'public',
  110. ],
  111. 'sqlsrv' => [
  112. 'driver' => 'sqlsrv',
  113. 'host' => env('DB_HOST', 'localhost'),
  114. 'database' => env('DB_DATABASE', 'forge'),
  115. 'username' => env('DB_USERNAME', 'forge'),
  116. 'password' => env('DB_PASSWORD', ''),
  117. 'charset' => 'utf8',
  118. 'prefix' => '',
  119. ],
  120. ],
  121. /*
  122. |--------------------------------------------------------------------------
  123. | Migration Repository Table
  124. |--------------------------------------------------------------------------
  125. |
  126. | This table keeps track of all the migrations that have already run for
  127. | your application. Using this information, we can determine which of
  128. | the migrations on disk haven't actually been run in the database.
  129. |
  130. */
  131. 'migrations' => 'migrations',
  132. /*
  133. |--------------------------------------------------------------------------
  134. | Redis Databases
  135. |--------------------------------------------------------------------------
  136. |
  137. | Redis is an open source, fast, and advanced key-value store that also
  138. | provides a richer set of commands than a typical key-value systems
  139. | such as APC or Memcached. Laravel makes it easy to dig right in.
  140. |
  141. */
  142. 'redis' => [
  143. 'cluster' => false,
  144. 'default' => [
  145. 'host' => env('WX_REDIS_HOST', 'localhost'),
  146. 'password' => env('WX_REDIS_PASSWORD', null),
  147. 'port' => env('WX_REDIS_PORT', 6379),
  148. 'database' => 0,
  149. ],
  150. 'test_redis' => [
  151. 'host' => env('TEST_REDIS_HOST', 'localhost'),
  152. 'password' => env('TEST_REDIS_PASSWORD', null),
  153. 'port' => env('TEST_REDIS_PORT', 6379),
  154. 'database' => 0,
  155. ],
  156. ],
  157. ];