database.php 828 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // config/database.php
  2. // database connection file
  3. <?php
  4. class Database
  5. {
  6. // specify your own database credentials
  7. private $host = '127.0.0.1';
  8. private $db_name = 'mint';
  9. private $username = 'postgras';
  10. private $password = '123456';
  11. public $conn;
  12. // public function __construct() {
  13. // }
  14. public function EloquentConnection()
  15. {
  16. return [
  17. 'driver' => 'pgsql',
  18. 'host' => $this->host,
  19. 'database' => $this->db_name,
  20. 'username' => $this->username,
  21. 'password' => $this->password,
  22. 'charset' => 'utf8',
  23. 'options' => [
  24. PDO::ATTR_PERSISTENT => true,
  25. ],
  26. 'prefix' => '',
  27. 'prefix_indexes' => true,
  28. 'schema' => 'public',
  29. 'sslmode' => 'prefer',
  30. ];
  31. }
  32. }