database.php 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | PDO Fetch Style
  6. |--------------------------------------------------------------------------
  7. |
  8. | By default, database results will be returned as instances of the PHP
  9. | stdClass object; however, you may desire to retrieve records in an
  10. | array format for simplicity. Here you can tweak the fetch style.
  11. |
  12. */
  13. 'fetch' => PDO::FETCH_CLASS,
  14. /*
  15. |--------------------------------------------------------------------------
  16. | Default Database Connection Name
  17. |--------------------------------------------------------------------------
  18. |
  19. | Here you may specify which of the database connections below you wish
  20. | to use as your default connection for all database work. Of course
  21. | you may use many connections at once using the Database library.
  22. |
  23. */
  24. 'default' => env('DB_CONNECTION', 'mysql'),
  25. /*
  26. |--------------------------------------------------------------------------
  27. | Database Connections
  28. |--------------------------------------------------------------------------
  29. |
  30. | Here are each of the database connections setup for your application.
  31. | Of course, examples of configuring each database platform that is
  32. | supported by Laravel is shown below to make development simple.
  33. |
  34. |
  35. | All database work in Laravel is done through the PHP PDO facilities
  36. | so make sure you have the driver for your particular database of
  37. | choice installed on your machine before you begin development.
  38. |
  39. */
  40. 'connections' => [
  41. 'testing' => [
  42. 'driver' => 'sqlite',
  43. 'database' => ':memory:',
  44. ],
  45. 'sqlite' => [
  46. 'driver' => 'sqlite',
  47. 'database' => env('DB_DATABASE', base_path('database/database.sqlite')),
  48. 'prefix' => env('DB_PREFIX', ''),
  49. ],
  50. 'mysql' => [
  51. 'driver' => 'mysql',
  52. 'host' => env('DB_HOST', 'localhost'),
  53. 'port' => env('DB_PORT', 3306),
  54. 'database' => env('DB_DATABASE', 'forge'),
  55. 'username' => env('DB_USERNAME', 'forge'),
  56. 'password' => env('DB_PASSWORD', ''),
  57. 'charset' => env('DB_CHARSET', 'utf8mb4'),
  58. 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
  59. 'prefix' => env('DB_PREFIX', ''),
  60. 'timezone' => env('DB_TIMEZONE', '+00:00'),
  61. 'strict' => env('DB_STRICT_MODE', false),
  62. ],
  63. 'pgsql' => [
  64. 'driver' => 'pgsql',
  65. 'host' => env('DB_HOST', 'localhost'),
  66. 'port' => env('DB_PORT', 5432),
  67. 'database' => env('DB_DATABASE', 'forge'),
  68. 'username' => env('DB_USERNAME', 'forge'),
  69. 'password' => env('DB_PASSWORD', ''),
  70. 'charset' => env('DB_CHARSET', 'utf8'),
  71. 'prefix' => env('DB_PREFIX', ''),
  72. 'schema' => env('DB_SCHEMA', 'public'),
  73. ],
  74. 'sqlsrv' => [
  75. 'driver' => 'sqlsrv',
  76. 'host' => env('DB_HOST', 'localhost'),
  77. 'database' => env('DB_DATABASE', 'forge'),
  78. 'username' => env('DB_USERNAME', 'forge'),
  79. 'password' => env('DB_PASSWORD', ''),
  80. 'charset' => env('DB_CHARSET', 'utf8'),
  81. 'prefix' => env('DB_PREFIX', ''),
  82. ],
  83. ],
  84. /*
  85. |--------------------------------------------------------------------------
  86. | Migration Repository Table
  87. |--------------------------------------------------------------------------
  88. |
  89. | This table keeps track of all the migrations that have already run for
  90. | your application. Using this information, we can determine which of
  91. | the migrations on disk haven't actually been run in the database.
  92. |
  93. */
  94. 'migrations' => 'migrations',
  95. /*
  96. |--------------------------------------------------------------------------
  97. | Redis Databases
  98. |--------------------------------------------------------------------------
  99. |
  100. | Redis is an open source, fast, and advanced key-value store that also
  101. | provides a richer set of commands than a typical key-value systems
  102. | such as APC or Memcached. Laravel makes it easy to dig right in.
  103. |
  104. */
  105. 'redis' => [
  106. 'cluster' => env('REDIS_CLUSTER', false),
  107. 'default' => [
  108. 'host' => env('REDIS_HOST', '127.0.0.1'),
  109. 'port' => env('REDIS_PORT', 6379),
  110. 'database' => env('REDIS_DATABASE', 0),
  111. 'password' => env('REDIS_PASSWORD', null),
  112. ],
  113. ],
  114. ];