database.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. 'charset' => 'utf8mb4',
  45. 'collation' => 'utf8mb4_unicode_ci',
  46. 'prefix' => '',
  47. 'strict' => false,
  48. 'engine' => null,
  49. ],
  50. 'pgsql' => [
  51. 'driver' => 'pgsql',
  52. 'host' => env('DB_HOST', '127.0.0.1'),
  53. 'port' => env('DB_PORT', '5432'),
  54. 'database' => env('DB_DATABASE', 'forge'),
  55. 'username' => env('DB_USERNAME', 'forge'),
  56. 'password' => env('DB_PASSWORD', ''),
  57. 'charset' => 'utf8',
  58. 'prefix' => '',
  59. 'schema' => 'public',
  60. 'sslmode' => 'prefer',
  61. ],
  62. 'sqlsrv' => [
  63. 'driver' => 'sqlsrv',
  64. 'host' => env('DB_HOST', 'localhost'),
  65. 'port' => env('DB_PORT', '1433'),
  66. 'database' => env('DB_DATABASE', 'forge'),
  67. 'username' => env('DB_USERNAME', 'forge'),
  68. 'password' => env('DB_PASSWORD', ''),
  69. 'charset' => 'utf8',
  70. 'prefix' => '',
  71. ],
  72. ],
  73. /*
  74. |--------------------------------------------------------------------------
  75. | Migration Repository Table
  76. |--------------------------------------------------------------------------
  77. |
  78. | This table keeps track of all the migrations that have already run for
  79. | your application. Using this information, we can determine which of
  80. | the migrations on disk haven't actually been run in the database.
  81. |
  82. */
  83. 'migrations' => 'migrations',
  84. /*
  85. |--------------------------------------------------------------------------
  86. | Redis Databases
  87. |--------------------------------------------------------------------------
  88. |
  89. | Redis is an open source, fast, and advanced key-value store that also
  90. | provides a richer set of commands than a typical key-value systems
  91. | such as APC or Memcached. Laravel makes it easy to dig right in.
  92. |
  93. */
  94. 'redis' => [
  95. 'client' => env('REDIS_CLIENT', 'predis'),
  96. 'default' => [
  97. 'scheme' => env('REDIS_SCHEME', 'tcp'),
  98. 'path' => env('REDIS_PATH'),
  99. 'host' => env('REDIS_HOST', '127.0.0.1'),
  100. 'password' => env('REDIS_PASSWORD', null),
  101. 'port' => env('REDIS_PORT', 6379),
  102. 'database' => env('REDIS_DATABASE', 0),
  103. ],
  104. ],
  105. 'dbal' => [
  106. 'types' => [
  107. 'timestamp' => TimestampType::class,
  108. ],
  109. ],
  110. ];