Simple problems require simple solutions
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.

173 lines
6.1 KiB

  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 database operations. This is
  11. | the connection which will be utilized unless another connection
  12. | is explicitly specified when you execute a query / statement.
  13. |
  14. */
  15. 'default' => env('DB_CONNECTION', 'sqlite'),
  16. /*
  17. |--------------------------------------------------------------------------
  18. | Database Connections
  19. |--------------------------------------------------------------------------
  20. |
  21. | Below are all of the database connections defined for your application.
  22. | An example configuration is provided for each database system which
  23. | is supported by Laravel. You're free to add / remove connections.
  24. |
  25. */
  26. 'connections' => [
  27. 'sqlite' => [
  28. 'driver' => 'sqlite',
  29. 'url' => env('DB_URL'),
  30. 'database' => env('DB_DATABASE', database_path('database.sqlite')),
  31. 'prefix' => '',
  32. 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
  33. 'busy_timeout' => null,
  34. 'journal_mode' => null,
  35. 'synchronous' => null,
  36. ],
  37. 'mysql' => [
  38. 'driver' => 'mysql',
  39. 'url' => env('DB_URL'),
  40. 'host' => env('DB_HOST', '127.0.0.1'),
  41. 'port' => env('DB_PORT', '3306'),
  42. 'database' => env('DB_DATABASE', 'laravel'),
  43. 'username' => env('DB_USERNAME', 'root'),
  44. 'password' => env('DB_PASSWORD', ''),
  45. 'unix_socket' => env('DB_SOCKET', ''),
  46. 'charset' => env('DB_CHARSET', 'utf8mb4'),
  47. 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
  48. 'prefix' => '',
  49. 'prefix_indexes' => true,
  50. 'strict' => true,
  51. 'engine' => null,
  52. 'options' => extension_loaded('pdo_mysql') ? array_filter([
  53. PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
  54. ]) : [],
  55. ],
  56. 'mariadb' => [
  57. 'driver' => 'mariadb',
  58. 'url' => env('DB_URL'),
  59. 'host' => env('DB_HOST', '127.0.0.1'),
  60. 'port' => env('DB_PORT', '3306'),
  61. 'database' => env('DB_DATABASE', 'laravel'),
  62. 'username' => env('DB_USERNAME', 'root'),
  63. 'password' => env('DB_PASSWORD', ''),
  64. 'unix_socket' => env('DB_SOCKET', ''),
  65. 'charset' => env('DB_CHARSET', 'utf8mb4'),
  66. 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
  67. 'prefix' => '',
  68. 'prefix_indexes' => true,
  69. 'strict' => true,
  70. 'engine' => null,
  71. 'options' => extension_loaded('pdo_mysql') ? array_filter([
  72. PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
  73. ]) : [],
  74. ],
  75. 'pgsql' => [
  76. 'driver' => 'pgsql',
  77. 'url' => env('DB_URL'),
  78. 'host' => env('DB_HOST', '127.0.0.1'),
  79. 'port' => env('DB_PORT', '5432'),
  80. 'database' => env('DB_DATABASE', 'laravel'),
  81. 'username' => env('DB_USERNAME', 'root'),
  82. 'password' => env('DB_PASSWORD', ''),
  83. 'charset' => env('DB_CHARSET', 'utf8'),
  84. 'prefix' => '',
  85. 'prefix_indexes' => true,
  86. 'search_path' => 'public',
  87. 'sslmode' => 'prefer',
  88. ],
  89. 'sqlsrv' => [
  90. 'driver' => 'sqlsrv',
  91. 'url' => env('DB_URL'),
  92. 'host' => env('DB_HOST', 'localhost'),
  93. 'port' => env('DB_PORT', '1433'),
  94. 'database' => env('DB_DATABASE', 'laravel'),
  95. 'username' => env('DB_USERNAME', 'root'),
  96. 'password' => env('DB_PASSWORD', ''),
  97. 'charset' => env('DB_CHARSET', 'utf8'),
  98. 'prefix' => '',
  99. 'prefix_indexes' => true,
  100. // 'encrypt' => env('DB_ENCRYPT', 'yes'),
  101. // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
  102. ],
  103. ],
  104. /*
  105. |--------------------------------------------------------------------------
  106. | Migration Repository Table
  107. |--------------------------------------------------------------------------
  108. |
  109. | This table keeps track of all the migrations that have already run for
  110. | your application. Using this information, we can determine which of
  111. | the migrations on disk haven't actually been run on the database.
  112. |
  113. */
  114. 'migrations' => [
  115. 'table' => 'migrations',
  116. 'update_date_on_publish' => true,
  117. ],
  118. /*
  119. |--------------------------------------------------------------------------
  120. | Redis Databases
  121. |--------------------------------------------------------------------------
  122. |
  123. | Redis is an open source, fast, and advanced key-value store that also
  124. | provides a richer body of commands than a typical key-value system
  125. | such as Memcached. You may define your connection settings here.
  126. |
  127. */
  128. 'redis' => [
  129. 'client' => env('REDIS_CLIENT', 'phpredis'),
  130. 'options' => [
  131. 'cluster' => env('REDIS_CLUSTER', 'redis'),
  132. 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
  133. ],
  134. 'default' => [
  135. 'url' => env('REDIS_URL'),
  136. 'host' => env('REDIS_HOST', '127.0.0.1'),
  137. 'username' => env('REDIS_USERNAME'),
  138. 'password' => env('REDIS_PASSWORD'),
  139. 'port' => env('REDIS_PORT', '6379'),
  140. 'database' => env('REDIS_DB', '0'),
  141. ],
  142. 'cache' => [
  143. 'url' => env('REDIS_URL'),
  144. 'host' => env('REDIS_HOST', '127.0.0.1'),
  145. 'username' => env('REDIS_USERNAME'),
  146. 'password' => env('REDIS_PASSWORD'),
  147. 'port' => env('REDIS_PORT', '6379'),
  148. 'database' => env('REDIS_CACHE_DB', '1'),
  149. ],
  150. ],
  151. ];