database.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. declare(strict_types=1);
  3. use Hypervel\Support\Str;
  4. return [
  5. /*
  6. |--------------------------------------------------------------------------
  7. | Default Database Connection Name
  8. |--------------------------------------------------------------------------
  9. |
  10. | Here you may specify which of the database connections below you wish
  11. | to use as your default connection for database operations. This is
  12. | the connection which will be utilized unless another connection
  13. | is explicitly specified when you execute a query / statement.
  14. |
  15. */
  16. 'default' => env('DB_CONNECTION', 'mysql'),
  17. 'connections' => [
  18. 'mysql' => [
  19. 'driver' => env('DB_DRIVER', 'mysql'),
  20. 'host' => env('DB_HOST', 'localhost'),
  21. 'database' => env('DB_DATABASE', 'hypervel'),
  22. 'port' => env('DB_PORT', 3306),
  23. 'username' => env('DB_USERNAME', 'root'),
  24. 'password' => env('DB_PASSWORD', ''),
  25. 'charset' => env('DB_CHARSET', 'utf8mb4'),
  26. 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
  27. 'prefix' => env('DB_PREFIX', ''),
  28. 'pool' => [
  29. 'min_connections' => 1,
  30. 'max_connections' => env('DB_MAX_CONNECTIONS', 10),
  31. 'connect_timeout' => 10.0,
  32. 'wait_timeout' => 3.0,
  33. 'heartbeat' => -1,
  34. 'max_idle_time' => (float) env('DB_MAX_IDLE_TIME', 60),
  35. ],
  36. ],
  37. 'pgsql' => [
  38. 'driver' => env('DB_DRIVER', 'pgsql'),
  39. 'host' => env('DB_HOST', 'localhost'),
  40. 'database' => env('DB_DATABASE', 'hypervel'),
  41. 'schema' => env('DB_SCHEMA', 'public'),
  42. 'port' => env('DB_PORT', 5432),
  43. 'username' => env('DB_USERNAME', 'root'),
  44. 'password' => env('DB_PASSWORD', ''),
  45. 'charset' => env('DB_CHARSET', 'utf8'),
  46. 'pool' => [
  47. 'min_connections' => 1,
  48. 'max_connections' => env('DB_MAX_CONNECTIONS', 10),
  49. 'connect_timeout' => 10.0,
  50. 'wait_timeout' => 3.0,
  51. 'heartbeat' => -1,
  52. 'max_idle_time' => (float) env('DB_MAX_IDLE_TIME', 60),
  53. ],
  54. ],
  55. 'sqlite' => [
  56. 'driver' => 'sqlite',
  57. 'url' => env('DATABASE_URL'),
  58. 'database' => env('DB_DATABASE', database_path('database.sqlite')),
  59. 'prefix' => '',
  60. 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
  61. ],
  62. 'sqlite_testing' => [
  63. 'driver' => 'sqlite',
  64. 'database' => ':memory:',
  65. 'prefix' => '',
  66. 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
  67. ],
  68. ],
  69. /*
  70. |--------------------------------------------------------------------------
  71. | Migration Repository Table
  72. |--------------------------------------------------------------------------
  73. |
  74. | This table keeps track of all the migrations that have already run for
  75. | your application. Using this information, we can determine which of
  76. | the migrations on disk haven't actually been run on the database.
  77. |
  78. */
  79. 'migrations' => 'migrations',
  80. /*
  81. |--------------------------------------------------------------------------
  82. | Redis Databases
  83. |--------------------------------------------------------------------------
  84. |
  85. | Redis is an open source, fast, and advanced key-value store that also
  86. | provides a richer body of commands than a typical key-value system
  87. | such as Memcached. You may define your connection settings here.
  88. |
  89. */
  90. 'redis' => [
  91. 'options' => [
  92. 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'hypervel'), '_') . '_database_'),
  93. ],
  94. 'default' => [
  95. 'host' => env('REDIS_HOST', 'localhost'),
  96. 'auth' => env('REDIS_AUTH', null),
  97. 'port' => (int) env('REDIS_PORT', 6379),
  98. 'db' => (int) env('REDIS_DB', 0),
  99. 'pool' => [
  100. 'min_connections' => 1,
  101. 'max_connections' => 10,
  102. 'connect_timeout' => 10.0,
  103. 'wait_timeout' => 3.0,
  104. 'heartbeat' => -1,
  105. 'max_idle_time' => (float) env('REDIS_MAX_IDLE_TIME', 60),
  106. ],
  107. ],
  108. 'queue' => [
  109. 'host' => env('REDIS_HOST', 'localhost'),
  110. 'auth' => env('REDIS_AUTH', null),
  111. 'port' => (int) env('REDIS_PORT', 6379),
  112. 'db' => (int) env('REDIS_DB', 0),
  113. 'pool' => [
  114. 'min_connections' => 1,
  115. 'max_connections' => 10,
  116. 'connect_timeout' => 10.0,
  117. 'wait_timeout' => 3.0,
  118. 'heartbeat' => -1,
  119. 'max_idle_time' => (float) env('REDIS_MAX_IDLE_TIME', 60),
  120. ],
  121. ],
  122. ],
  123. ];