public function dbConnection(array $configs = null, $name = 'default', $enableQueryLog = true)
	{
		$db = new DB();

		$db->addConnection(($configs) ? $configs : $this->config('db'), $name);
        $db->setEventDispatcher(new Dispatcher(new Container));
		$db->setAsGlobal();
		$db->bootEloquent();

        if ($enableQueryLog)
        {
            DB::connection()->enableQueryLog();
        }

        $this->db = $db;

        return $db;
	}
public function dbConnection(array $configs = null, $name = 'default', $enableQueryLog = true)
	{
		$db = new DB();

		$db->addConnection(($configs) ? $configs : $this->config('db'), $name);
        $db->setEventDispatcher(new Dispatcher(new Container));
		$db->setAsGlobal();
		$db->bootEloquent();

        if ($enableQueryLog)
        {
            DB::connection()->enableQueryLog();
        }

        $this->db = $db;

        return $db;
	}
public function dbConnection ( array $ configs = null , $ name = 'default' , $ enableQueryLog = true ) { $ db = new DB ( ) ; $ db -> addConnection ( ( $ configs ) ? $ configs : $ this -> config ( 'db' ) , $ name ) ; $ db -> setEventDispatcher ( new Dispatcher ( new Container ) ) ; $ db -> setAsGlobal ( ) ; $ db -> bootEloquent ( ) ; if ( $ enableQueryLog ) { DB :: connection ( ) -> enableQueryLog ( ) ; } $ this -> db = $ db ; return $ db ; }
Configure the database and boot Eloquent

@param array $configs null
@param string $name default
@param bool $enableQueryLog true
@return mixed
Configure the database and boot Eloquent