database.php 4.1 KB

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