19 lines
446 B
PHP
19 lines
446 B
PHP
|
<?php
|
||
|
require "vendor/autoload.php";
|
||
|
|
||
|
use Dotenv\Dotenv;
|
||
|
use Illuminate\Database\Capsule\Manager as Capsule;
|
||
|
|
||
|
$dotenv = Dotenv::createImmutable(ROOT_PATH);
|
||
|
$dotenv->load();
|
||
|
|
||
|
$capsule = new Capsule;
|
||
|
$capsule->addConnection([
|
||
|
"driver" => "mysql",
|
||
|
"host" => $_ENV['DB_HOST'],
|
||
|
"database" => $_ENV['DB_NAME'],
|
||
|
"username" => $_ENV['DB_USER'],
|
||
|
"password" => $_ENV['DB_PASSWORD']
|
||
|
]);
|
||
|
$capsule->setAsGlobal();
|
||
|
$capsule->bootEloquent();
|