database.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <?php
  2. use Illuminate\Database\DBAL\TimestampType;
  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. 'database' => env('DB_DATABASE', database_path('database.sqlite')),
  34. 'prefix' => '',
  35. ],
  36. 'mysql' => [
  37. 'driver' => 'mysql',
  38. 'host' => env('DB_HOST', '127.0.0.1'),
  39. 'port' => env('DB_PORT', '3306'),
  40. 'database' => env('DB_DATABASE', 'forge'),
  41. 'username' => env('DB_USERNAME', 'forge'),
  42. 'password' => env('DB_PASSWORD', ''),
  43. 'unix_socket' => env('DB_SOCKET', ''),
  44. 'sticky' => true,
  45. 'charset' => 'utf8mb4',
  46. 'collation' => 'utf8mb4_unicode_ci',
  47. 'prefix' => '',
  48. 'strict' => false,
  49. 'engine' => null,
  50. 'dump' => [
  51. 'use_single_transaction',
  52. 'skip_lock_tables',
  53. ]
  54. ],
  55. 'mariadb' => [
  56. 'driver' => 'mariadb',
  57. 'url' => env('DB_URL'),
  58. 'host' => env('DB_HOST', '127.0.0.1'),
  59. 'port' => env('DB_PORT', '3306'),
  60. 'database' => env('DB_DATABASE', 'laravel'),
  61. 'username' => env('DB_USERNAME', 'root'),
  62. 'password' => env('DB_PASSWORD', ''),
  63. 'unix_socket' => env('DB_SOCKET', ''),
  64. 'charset' => env('DB_CHARSET', 'utf8mb4'),
  65. 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
  66. 'prefix' => '',
  67. 'prefix_indexes' => true,
  68. 'strict' => true,
  69. 'engine' => null,
  70. 'options' => extension_loaded('pdo_mysql') ? array_filter([
  71. PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
  72. ]) : [],
  73. ],
  74. 'pgsql' => [
  75. 'driver' => 'pgsql',
  76. 'host' => env('DB_HOST', '127.0.0.1'),
  77. 'port' => env('DB_PORT', '5432'),
  78. 'database' => env('DB_DATABASE', 'forge'),
  79. 'username' => env('DB_USERNAME', 'forge'),
  80. 'password' => env('DB_PASSWORD', ''),
  81. 'charset' => 'utf8',
  82. 'prefix' => '',
  83. 'schema' => 'public',
  84. 'sslmode' => 'prefer',
  85. ],
  86. 'sqlsrv' => [
  87. 'driver' => 'sqlsrv',
  88. 'host' => env('DB_HOST', 'localhost'),
  89. 'port' => env('DB_PORT', '1433'),
  90. 'database' => env('DB_DATABASE', 'forge'),
  91. 'username' => env('DB_USERNAME', 'forge'),
  92. 'password' => env('DB_PASSWORD', ''),
  93. 'charset' => 'utf8',
  94. 'prefix' => '',
  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 set of commands than a typical key-value systems
  115. | such as APC or Memcached. Laravel makes it easy to dig right in.
  116. |
  117. */
  118. 'redis' => [
  119. 'client' => env('REDIS_CLIENT', 'predis'),
  120. 'default' => [
  121. 'scheme' => env('REDIS_SCHEME', 'tcp'),
  122. 'path' => env('REDIS_PATH'),
  123. 'host' => env('REDIS_HOST', '127.0.0.1'),
  124. 'password' => env('REDIS_PASSWORD', null),
  125. 'port' => env('REDIS_PORT', 6379),
  126. 'database' => env('REDIS_DATABASE', 0),
  127. ],
  128. 'session' => [
  129. 'scheme' => env('REDIS_SCHEME', 'tcp'),
  130. 'path' => env('REDIS_PATH'),
  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_DATABASE_SESSION', 1),
  135. ],
  136. 'pulse' => [
  137. 'scheme' => env('REDIS_SCHEME', 'tcp'),
  138. 'path' => env('REDIS_PATH'),
  139. 'host' => env('REDIS_HOST', '127.0.0.1'),
  140. 'password' => env('REDIS_PASSWORD', null),
  141. 'port' => env('REDIS_PORT', 6379),
  142. 'database' => env('REDIS_DATABASE_PULSE', 2),
  143. ],
  144. ],
  145. 'dbal' => [
  146. 'types' => [
  147. 'timestamp' => TimestampType::class,
  148. ],
  149. ],
  150. ];