database.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <?php
  2. use Illuminate\Support\Str;
  3. return [
  4. /*
  5. |--------------------------------------------------------------------------
  6. | Default Database Connection Name
  7. |--------------------------------------------------------------------------
  8. |
  9. | Here you may specify which of the database connections below you wish
  10. | to use as your default connection for all database work. Of course
  11. | you may use many connections at once using the Database library.
  12. |
  13. */
  14. 'default' => env('DB_CONNECTION', 'mysql'),
  15. /*
  16. |--------------------------------------------------------------------------
  17. | Database Connections
  18. |--------------------------------------------------------------------------
  19. |
  20. | Here are each of the database connections setup for your application.
  21. | Of course, examples of configuring each database platform that is
  22. | supported by Laravel is shown below to make development simple.
  23. |
  24. |
  25. | All database work in Laravel is done through the PHP PDO facilities
  26. | so make sure you have the driver for your particular database of
  27. | choice installed on your machine before you begin development.
  28. |
  29. */
  30. 'connections' => [
  31. 'sqlite' => [
  32. 'driver' => 'sqlite',
  33. 'url' => env('DATABASE_URL'),
  34. 'database' => env('DB_DATABASE', database_path('database.sqlite')),
  35. 'prefix' => '',
  36. 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
  37. ],
  38. 'mysql_s' => [
  39. 'driver' => 'mysql',
  40. 'url' => env('DATABASE_URL'),
  41. 'host' => env('DB_HOST_S', '127.0.0.1'),
  42. 'port' => env('DB_PORT_S', '3306'),
  43. 'database' => env('DB_DATABASE_S', 'forge'),
  44. 'username' => env('DB_USERNAME_S', 'forge'),
  45. 'password' => env('DB_PASSWORD_S', ''),
  46. 'unix_socket' => env('DB_SOCKET', ''),
  47. 'charset' => 'utf8mb4',
  48. 'collation' => 'utf8mb4_unicode_ci',
  49. 'prefix' => '',
  50. 'prefix_indexes' => true,
  51. 'strict' => false,
  52. 'engine' => null,
  53. 'options' => extension_loaded('pdo_mysql') ? array_filter([
  54. PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
  55. ]) : [],
  56. ],
  57. 'mysql_z' => [
  58. 'driver' => 'mysql',
  59. 'url' => env('DATABASE_URL'),
  60. 'host' => env('DB_HOST_Z', '127.0.0.1'),
  61. 'port' => env('DB_PORT_Z', '3306'),
  62. 'database' => env('DB_DATABASE_Z', 'forge'),
  63. 'username' => env('DB_USERNAME_Z', 'forge'),
  64. 'password' => env('DB_PASSWORD_Z', ''),
  65. 'unix_socket' => env('DB_SOCKET', ''),
  66. 'charset' => 'utf8mb4',
  67. 'collation' => 'utf8mb4_unicode_ci',
  68. 'prefix' => '',
  69. 'prefix_indexes' => true,
  70. 'strict' => false,
  71. 'engine' => null,
  72. 'options' => extension_loaded('pdo_mysql') ? array_filter([
  73. PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
  74. ]) : [],
  75. ],
  76. 'mysql_w' => [
  77. 'driver' => 'mysql',
  78. 'url' => env('DATABASE_URL'),
  79. 'host' => env('DB_HOST_W', '127.0.0.1'),
  80. 'port' => env('DB_PORT_W', '3306'),
  81. 'database' => env('DB_DATABASE_W', 'forge'),
  82. 'username' => env('DB_USERNAME_W', 'forge'),
  83. 'password' => env('DB_PASSWORD_W', ''),
  84. 'unix_socket' => env('DB_SOCKET', ''),
  85. 'charset' => 'utf8mb4',
  86. 'collation' => 'utf8mb4_unicode_ci',
  87. 'prefix' => '',
  88. 'prefix_indexes' => true,
  89. 'strict' => false,
  90. 'engine' => null,
  91. 'options' => extension_loaded('pdo_mysql') ? array_filter([
  92. PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
  93. ]) : [],
  94. ],
  95. 'mysql' => [
  96. 'driver' => 'mysql',
  97. 'url' => env('DATABASE_URL'),
  98. 'host' => env('DB_HOST', '127.0.0.1'),
  99. 'port' => env('DB_PORT', '3306'),
  100. 'database' => env('DB_DATABASE', 'forge'),
  101. 'username' => env('DB_USERNAME', 'forge'),
  102. 'password' => env('DB_PASSWORD', ''),
  103. 'unix_socket' => env('DB_SOCKET', ''),
  104. 'charset' => 'utf8mb4',
  105. 'collation' => 'utf8mb4_unicode_ci',
  106. 'prefix' => '',
  107. 'prefix_indexes' => true,
  108. 'strict' => false,
  109. 'engine' => null,
  110. 'options' => extension_loaded('pdo_mysql') ? array_filter([
  111. PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
  112. ]) : [],
  113. ],
  114. 'pgsql' => [
  115. 'driver' => 'pgsql',
  116. 'url' => env('DATABASE_URL'),
  117. 'host' => env('DB_HOST', '127.0.0.1'),
  118. 'port' => env('DB_PORT', '5432'),
  119. 'database' => env('DB_DATABASE', 'forge'),
  120. 'username' => env('DB_USERNAME', 'forge'),
  121. 'password' => env('DB_PASSWORD', ''),
  122. 'charset' => 'utf8',
  123. 'prefix' => '',
  124. 'prefix_indexes' => true,
  125. 'schema' => 'public',
  126. 'sslmode' => 'prefer',
  127. ],
  128. 'sqlsrv' => [
  129. 'driver' => 'sqlsrv',
  130. 'url' => env('DATABASE_URL'),
  131. 'host' => env('DB_HOST', 'localhost'),
  132. 'port' => env('DB_PORT', '1433'),
  133. 'database' => env('DB_DATABASE', 'forge'),
  134. 'username' => env('DB_USERNAME', 'forge'),
  135. 'password' => env('DB_PASSWORD', ''),
  136. 'charset' => 'utf8',
  137. 'prefix' => '',
  138. 'prefix_indexes' => true,
  139. ],
  140. ],
  141. /*
  142. |--------------------------------------------------------------------------
  143. | Migration Repository Table
  144. |--------------------------------------------------------------------------
  145. |
  146. | This table keeps track of all the migrations that have already run for
  147. | your application. Using this information, we can determine which of
  148. | the migrations on disk haven't actually been run in the database.
  149. |
  150. */
  151. 'migrations' => 'migrations',
  152. /*
  153. |--------------------------------------------------------------------------
  154. | Redis Databases
  155. |--------------------------------------------------------------------------
  156. |
  157. | Redis is an open source, fast, and advanced key-value store that also
  158. | provides a richer body of commands than a typical key-value system
  159. | such as APC or Memcached. Laravel makes it easy to dig right in.
  160. |
  161. */
  162. 'redis' => [
  163. 'client' => env('REDIS_CLIENT', 'phpredis'),
  164. 'options' => [
  165. 'cluster' => env('REDIS_CLUSTER', 'redis'),
  166. 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
  167. ],
  168. 'default' => [
  169. 'url' => env('REDIS_URL'),
  170. 'host' => env('REDIS_HOST', '127.0.0.1'),
  171. 'password' => env('REDIS_PASSWORD', null),
  172. 'port' => env('REDIS_PORT', '6379'),
  173. 'database' => env('REDIS_DB', '0'),
  174. ],
  175. 'cache' => [
  176. 'url' => env('REDIS_URL'),
  177. 'host' => env('REDIS_HOST', '127.0.0.1'),
  178. 'password' => env('REDIS_PASSWORD', null),
  179. 'port' => env('REDIS_PORT', '6379'),
  180. 'database' => env('REDIS_CACHE_DB', '1'),
  181. ],
  182. ],
  183. ];