You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

163 lines
5.6 KiB

2 years ago
  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' => [
  39. 'driver' => 'mysql',
  40. 'url' => env('DATABASE_URL'),
  41. 'host' => env('DB_HOST', '127.0.0.1'),
  42. 'port' => env('DB_PORT', '3306'),
  43. 'database' => env('DB_DATABASE', 'forge'),
  44. 'username' => env('DB_USERNAME', 'forge'),
  45. 'password' => env('DB_PASSWORD', ''),
  46. 'unix_socket' => env('DB_SOCKET', ''),
  47. 'charset' => 'utf8mb4',
  48. 'collation' => 'utf8mb4_unicode_ci',
  49. 'prefix' => '',
  50. 'prefix_indexes' => true,
  51. 'strict' => true,
  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. 'pgsql' => [
  58. 'driver' => 'pgsql',
  59. 'url' => env('DATABASE_URL'),
  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' => 'utf8',
  66. 'prefix' => '',
  67. 'prefix_indexes' => true,
  68. 'search_path' => 'public',
  69. 'sslmode' => 'prefer',
  70. ],
  71. 'sqlsrv' => [
  72. 'driver' => 'sqlsrv',
  73. 'url' => env('DATABASE_URL'),
  74. 'host' => env('DB_HOST', 'localhost'),
  75. 'port' => env('DB_PORT', '1433'),
  76. 'database' => env('DB_DATABASE', 'forge'),
  77. 'username' => env('DB_USERNAME', 'forge'),
  78. 'password' => env('DB_PASSWORD', ''),
  79. 'charset' => 'utf8',
  80. 'prefix' => '',
  81. 'prefix_indexes' => true,
  82. // 'encrypt' => env('DB_ENCRYPT', 'yes'),
  83. // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
  84. ],
  85. 'mongodb' => [
  86. 'driver' => 'mongodb',
  87. 'host' => env('MONGO_HOST', 'mongodb'),
  88. 'port' => env('MONGO_PORT', 27017),
  89. 'database' => env('MONGO_DATABASE', 'test'),
  90. 'username' => env('MONGO_USERNAME', 'root'),
  91. 'password' => env('MONGO_PASSWORD', 'root'),
  92. 'options' => [
  93. 'database' => env('DB_AUTHENTICATION_DATABASE', 'admin'), // required with Mongo 3+
  94. ],
  95. ],
  96. ],
  97. /*
  98. |--------------------------------------------------------------------------
  99. | Migration Repository Table
  100. |--------------------------------------------------------------------------
  101. |
  102. | This table keeps track of all the migrations that have already run for
  103. | your application. Using this information, we can determine which of
  104. | the migrations on disk haven't actually been run in the database.
  105. |
  106. */
  107. 'migrations' => 'migrations',
  108. /*
  109. |--------------------------------------------------------------------------
  110. | Redis Databases
  111. |--------------------------------------------------------------------------
  112. |
  113. | Redis is an open source, fast, and advanced key-value store that also
  114. | provides a richer body of commands than a typical key-value system
  115. | such as APC or Memcached. Laravel makes it easy to dig right in.
  116. |
  117. */
  118. 'redis' => [
  119. 'client' => env('REDIS_CLIENT', 'phpredis'),
  120. 'options' => [
  121. 'cluster' => env('REDIS_CLUSTER', 'redis'),
  122. 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
  123. ],
  124. 'default' => [
  125. 'url' => env('REDIS_URL'),
  126. 'host' => env('REDIS_HOST', '127.0.0.1'),
  127. 'username' => env('REDIS_USERNAME'),
  128. 'password' => env('REDIS_PASSWORD'),
  129. 'port' => env('REDIS_PORT', '6379'),
  130. 'database' => env('REDIS_DB', '0'),
  131. ],
  132. 'cache' => [
  133. 'url' => env('REDIS_URL'),
  134. 'host' => env('REDIS_HOST', '127.0.0.1'),
  135. 'username' => env('REDIS_USERNAME'),
  136. 'password' => env('REDIS_PASSWORD'),
  137. 'port' => env('REDIS_PORT', '6379'),
  138. 'database' => env('REDIS_CACHE_DB', '1'),
  139. ],
  140. ],
  141. ];