database.php 711 B

1234567891011121314151617181920212223242526272829303132
  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 = 'eloquent';
  9. private $username = 'root';
  10. private $password = 'password';
  11. public $conn;
  12. // public function __construct() {
  13. // }
  14. public function EloquentConnection()
  15. {
  16. return [
  17. 'driver' => 'mysql',
  18. 'host' => $this->host,
  19. 'database' => $this->db_name,
  20. 'username' => $this->username,
  21. 'password' => $this->password,
  22. 'charset' => 'utf8',
  23. 'collation' => 'utf8_unicode_ci',
  24. 'prefix' => '',
  25. ];
  26. }
  27. }