database.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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 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. 'url' => env('DATABASE_URL'),
  34. 'database' => env('DB_DATABASE', database_path('database.sqlite')),
  35. 'prefix' => '',
  36. 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
  37. ],
  38. 'mysql' => [
  39. 'driver' => 'mysql',
  40. 'url' => env('DATABASE_URL'),
  41. 'host' => env('DB_HOST', '127.0.0.1'),
  42. 'port' => env('DB_PORT', '3306'),
  43. 'database' => env('DB_DATABASE', 'forge'),
  44. 'username' => env('DB_USERNAME', 'forge'),
  45. 'password' => env('DB_PASSWORD', ''),
  46. 'unix_socket' => env('DB_SOCKET', ''),
  47. 'charset' => 'utf8mb4',
  48. 'collation' => 'utf8mb4_unicode_ci',
  49. 'prefix' => '',
  50. 'prefix_indexes' => true,
  51. 'strict' => false,
  52. 'engine' => null,
  53. 'options' => extension_loaded('pdo_mysql') ? array_filter([
  54. PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
  55. ]) : [],
  56. ],
  57. 'oracle' => [
  58. 'driver' => env('ORACLE_DRIVER', 'oracle'),
  59. 'host' => env('ORACLE_HOST', '47.103.12.61'),
  60. 'port' => env('ORACLE_PORT', '1521'),
  61. 'database'=> env('ORACLE_DATABASE', ''),
  62. 'service_name' => env('ORACLE_SERVICE_NAME', 'orcl'),
  63. 'username' => env('ORACLE_USERNAME', 'WMS_USER'),
  64. 'password' => env('ORACLE_PASSWORD', 'WMS_USER'),
  65. 'charset' => env('ORACLE_CHARSET', 'utf8'),
  66. 'prefix' => env('ORACLE_PREFIX', ''),
  67. ],
  68. 'erp' => [
  69. 'driver' => env('ERP_CONNECTION', 'mysql'),
  70. 'host' => env('ERP_HOST', 'erp.baoshi56.com'),
  71. 'port' => env('ERP_PORT', '3306'),
  72. 'database'=> env('ERP_DATABASE', 'purch'),
  73. 'username' => env('ERP_USERNAME', 'root'),
  74. 'password' => env('ERP_PASSWORD', 'root'),
  75. 'charset' => env('ERP_CHARSET', 'utf8'),
  76. 'prefix' => env('ERP_PREFIX', ''),
  77. ],
  78. 'pgsql' => [
  79. 'driver' => 'pgsql',
  80. 'url' => env('DATABASE_URL'),
  81. 'host' => env('DB_HOST', '127.0.0.1'),
  82. 'port' => env('DB_PORT', '5432'),
  83. 'database' => env('DB_DATABASE', 'forge'),
  84. 'username' => env('DB_USERNAME', 'forge'),
  85. 'password' => env('DB_PASSWORD', ''),
  86. 'charset' => 'utf8',
  87. 'prefix' => '',
  88. 'prefix_indexes' => true,
  89. 'schema' => 'public',
  90. 'sslmode' => 'prefer',
  91. ],
  92. 'sqlsrv' => [
  93. 'driver' => 'sqlsrv',
  94. 'url' => env('DATABASE_URL'),
  95. 'host' => env('DB_HOST', 'localhost'),
  96. 'port' => env('DB_PORT', '1433'),
  97. 'database' => env('DB_DATABASE', 'forge'),
  98. 'username' => env('DB_USERNAME', 'forge'),
  99. 'password' => env('DB_PASSWORD', ''),
  100. 'charset' => 'utf8',
  101. 'prefix' => '',
  102. 'prefix_indexes' => true,
  103. ],
  104. ],
  105. /*
  106. |--------------------------------------------------------------------------
  107. | Migration Repository Table
  108. |--------------------------------------------------------------------------
  109. |
  110. | This table keeps track of all the migrations that have already run for
  111. | your application. Using this information, we can determine which of
  112. | the migrations on disk haven't actually been run in the database.
  113. |
  114. */
  115. 'migrations' => 'migrations',
  116. /*
  117. |--------------------------------------------------------------------------
  118. | Redis Databases
  119. |--------------------------------------------------------------------------
  120. |
  121. | Redis is an open source, fast, and advanced key-value store that also
  122. | provides a richer body of commands than a typical key-value system
  123. | such as APC or Memcached. Laravel makes it easy to dig right in.
  124. |
  125. */
  126. 'redis' => [
  127. 'client' => env('REDIS_CLIENT', 'predis'),
  128. 'options' => [
  129. 'cluster' => env('REDIS_CLUSTER', 'predis'),
  130. 'prefix' => Str::slug(env('APP_NAME', 'laravel'), '_').'_database_',
  131. ],
  132. 'default' => [
  133. 'url' => env('REDIS_URL'),
  134. 'host' => env('REDIS_HOST', '127.0.0.1'),
  135. 'password' => env('REDIS_PASSWORD', null),
  136. 'port' => env('REDIS_PORT', 6379),
  137. 'database' => env('REDIS_DB', 0),
  138. ],
  139. 'cache' => [
  140. 'url' => env('REDIS_URL'),
  141. 'host' => env('REDIS_HOST', '127.0.0.1'),
  142. 'password' => env('REDIS_PASSWORD', null),
  143. 'port' => env('REDIS_PORT', 6379),
  144. 'database' => env('REDIS_CACHE_DB', 1),
  145. ],
  146. ],
  147. ];