database.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <?php
  2. /*
  3. * This file is part of the Jiannei/lumen-api-starter.
  4. *
  5. * (c) Jiannei <longjian.huang@foxmail.com>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. return [
  11. /*
  12. |--------------------------------------------------------------------------
  13. | Default Database Connection Name
  14. |--------------------------------------------------------------------------
  15. |
  16. | Here you may specify which of the database connections below you wish
  17. | to use as your default connection for all database work. Of course
  18. | you may use many connections at once using the Database library.
  19. |
  20. */
  21. 'default' => env('DB_CONNECTION', 'mysql'),
  22. /*
  23. |--------------------------------------------------------------------------
  24. | Database Connections
  25. |--------------------------------------------------------------------------
  26. |
  27. | Here are each of the database connections setup for your application.
  28. | Of course, examples of configuring each database platform that is
  29. | supported by Laravel is shown below to make development simple.
  30. |
  31. |
  32. | All database work in Laravel is done through the PHP PDO facilities
  33. | so make sure you have the driver for your particular database of
  34. | choice installed on your machine before you begin development.
  35. |
  36. */
  37. 'connections' => [
  38. 'sqlite' => [
  39. 'driver' => 'sqlite',
  40. 'database' => env('DB_DATABASE', database_path('database.sqlite')),
  41. 'prefix' => env('DB_PREFIX', ''),
  42. ],
  43. 'mysql' => [
  44. 'driver' => 'mysql',
  45. 'host' => env('DB_HOST', '127.0.0.1'),
  46. 'port' => env('DB_PORT', 3306),
  47. 'database' => env('DB_DATABASE', 'forge'),
  48. 'username' => env('DB_USERNAME', 'forge'),
  49. 'password' => env('DB_PASSWORD', ''),
  50. 'unix_socket' => env('DB_SOCKET', ''),
  51. 'charset' => env('DB_CHARSET', 'utf8mb4'),
  52. 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
  53. 'prefix' => env('DB_PREFIX', ''),
  54. 'strict' => env('DB_STRICT_MODE', false),
  55. 'engine' => env('DB_ENGINE', null),
  56. 'timezone' => env('DB_TIMEZONE', '+08:00'),
  57. ],
  58. 'pgsql' => [
  59. 'driver' => 'pgsql',
  60. 'host' => env('DB_HOST', '127.0.0.1'),
  61. 'port' => env('DB_PORT', 5432),
  62. 'database' => env('DB_DATABASE', 'forge'),
  63. 'username' => env('DB_USERNAME', 'forge'),
  64. 'password' => env('DB_PASSWORD', ''),
  65. 'charset' => env('DB_CHARSET', 'utf8'),
  66. 'prefix' => env('DB_PREFIX', ''),
  67. 'schema' => env('DB_SCHEMA', 'public'),
  68. 'sslmode' => env('DB_SSL_MODE', 'prefer'),
  69. ],
  70. 'sqlsrv' => [
  71. 'driver' => 'sqlsrv',
  72. 'host' => env('DB_HOST', 'localhost'),
  73. 'port' => env('DB_PORT', 1433),
  74. 'database' => env('DB_DATABASE', 'forge'),
  75. 'username' => env('DB_USERNAME', 'forge'),
  76. 'password' => env('DB_PASSWORD', ''),
  77. 'charset' => env('DB_CHARSET', 'utf8'),
  78. 'prefix' => env('DB_PREFIX', ''),
  79. ],
  80. 'mongodb' => [
  81. 'driver' => 'mongodb',
  82. 'host' => env('MONGODB_HOST', '127.0.0.1'),
  83. 'port' => env('MONGODB_PORT', 27017),
  84. 'username' => env('MONGODB_USERNAME', ''),
  85. 'password' => env('MONGODB_PASSWORD', ''),
  86. 'database' => env('MONGODB_DATABASE', ''),
  87. 'options' => [
  88. // here you can pass more settings to the Mongo Driver Manager
  89. // see https://www.php.net/manual/en/mongodb-driver-manager.construct.php under "Uri Options" for a list of complete parameters that you can use
  90. 'database' => env('MONGODB_AUTHENTICATION_DATABASE', 'admin'), // required with Mongo 3+
  91. ],
  92. ],
  93. ],
  94. /*
  95. |--------------------------------------------------------------------------
  96. | Migration Repository Table
  97. |--------------------------------------------------------------------------
  98. |
  99. | This table keeps track of all the migrations that have already run for
  100. | your application. Using this information, we can determine which of
  101. | the migrations on disk haven't actually been run in the database.
  102. |
  103. */
  104. 'migrations' => 'migrations',
  105. /*
  106. |--------------------------------------------------------------------------
  107. | Redis Databases
  108. |--------------------------------------------------------------------------
  109. |
  110. | Redis is an open source, fast, and advanced key-value store that also
  111. | provides a richer set of commands than a typical key-value systems
  112. | such as APC or Memcached. Laravel makes it easy to dig right in.
  113. |
  114. */
  115. 'redis' => [
  116. 'client' => env('REDIS_CLIENT', 'phpredis'),
  117. 'cluster' => env('REDIS_CLUSTER', false),
  118. 'default' => [
  119. 'host' => env('REDIS_HOST', '127.0.0.1'),
  120. 'password' => env('REDIS_PASSWORD', null),
  121. 'port' => env('REDIS_PORT', 6379),
  122. 'database' => env('REDIS_DB', 3),
  123. ],
  124. 'cache' => [
  125. 'host' => env('REDIS_HOST', '127.0.0.1'),
  126. 'password' => env('REDIS_PASSWORD', null),
  127. 'port' => env('REDIS_PORT', 6379),
  128. 'database' => env('REDIS_CACHE_DB', 1),
  129. ],
  130. 'queue' => [
  131. 'host' => env('REDIS_HOST', '127.0.0.1'),
  132. 'password' => env('REDIS_PASSWORD', null),
  133. 'port' => env('REDIS_PORT', 6379),
  134. 'database' => env('REDIS_QUEUE_DB', 2),
  135. ],
  136. ],
  137. ];