<?php

namespace App\Libreria;

use Illuminate\Database\Capsule\Manager as Capsule;

class Conexion
{
    protected $capsule;

    public function __construct()
    {
        $this->capsule = new Capsule;

        $this->capsule->addConnection([
            'driver'    => 'mysql',
            'host'      => 'localhost',
            'database'  => 'munimazamarigob_mesadepartes',
            'username'  => 'root',
            'password'  => '',
            'charset'   => 'utf8',
            'collation' => 'utf8_general_ci',
            'prefix'    => '',
            'port'      => '3306'
        ]);

        $this->capsule->setAsGlobal();
        $this->capsule->bootEloquent();
        
        session_start();
        date_default_timezone_set('America/Lima');
    }
    public function connection()
    {
        return $this->capsule->getConnection();
    }
}
