databases.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. use function Hyperf\Support\env;
  12. return [
  13. 'default' => [
  14. 'driver' => env('DB_DRIVER', 'mysql'),
  15. 'host' => env('DB_HOST', 'localhost'),
  16. 'database' => env('DB_DATABASE', 'hyperf'),
  17. 'port' => env('DB_PORT', 3306),
  18. 'username' => env('DB_USERNAME', 'root'),
  19. 'password' => env('DB_PASSWORD', ''),
  20. 'charset' => env('DB_CHARSET', 'utf8mb4'),
  21. 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
  22. 'prefix' => env('DB_PREFIX', ''),
  23. 'pool' => [
  24. 'min_connections' => 1,
  25. 'max_connections' => 10,
  26. 'connect_timeout' => 10.0,
  27. 'wait_timeout' => 3.0,
  28. 'heartbeat' => -1,
  29. 'max_idle_time' => (float) env('DB_MAX_IDLE_TIME', 60),
  30. ],
  31. 'commands' => [
  32. 'gen:model' => [
  33. 'path' => 'app/Model',
  34. 'force_casts' => true,
  35. 'inheritance' => 'Model',
  36. ],
  37. ],
  38. ],
  39. ];