MicroFrameWork/app/models/Database.php

22 lines
567 B
PHP
Raw Normal View History

2024-07-03 14:41:15 +03:00
<?php
2024-07-03 15:15:59 +03:00
namespace app\models;
2024-07-03 14:41:15 +03:00
use Illuminate\Database\Capsule\Manager as Capsule;
class Database {
public function __construct()
{
$capsule = new Capsule;
$capsule->addConnection([
'driver' => DBDRIVER,
'host' => DBHOST,
'database' => DBNAME,
'username' => DBUSER,
'password' => DBPASS,
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
]);
// Setup the Eloquent ORM…
$capsule->bootEloquent();
}
}