From ce90c5b7ff5142f1718f760339bb1f0f9df8f9aa Mon Sep 17 00:00:00 2001 From: AnixPasBesoin Date: Mon, 25 Feb 2019 17:44:33 +0100 Subject: [PATCH] Fixed database connection resolution --- src/LiveControl/EloquentDataTable/DataTable.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/LiveControl/EloquentDataTable/DataTable.php b/src/LiveControl/EloquentDataTable/DataTable.php index b226dd3..87886ff 100644 --- a/src/LiveControl/EloquentDataTable/DataTable.php +++ b/src/LiveControl/EloquentDataTable/DataTable.php @@ -234,7 +234,7 @@ protected function getRawColumnQuery($column) return 'CONCAT(' . implode(', " ", ', $this->getRawColumns($column)) . ')'; } - return Model::resolveConnection()->getQueryGrammar()->wrap($column); + return $this->builder->getConnection()->getQueryGrammar()->wrap($column); } /** @@ -242,7 +242,7 @@ protected function getRawColumnQuery($column) */ protected function getDatabaseDriver() { - return Model::resolveConnection()->getDriverName(); + return $this->builder->getConnection()->getDriverName(); } /** @@ -253,7 +253,7 @@ protected function addSelect() $rawSelect = []; foreach ($this->columns as $index => $column) { if (isset($this->rawColumns[$index])) { - $rawSelect[] = $this->rawColumns[$index] . ' as ' . Model::resolveConnection()->getQueryGrammar()->wrap($this->columnNames[$index]); + $rawSelect[] = $this->rawColumns[$index] . ' as ' . $this->builder->getConnection()->getQueryGrammar()->wrap($this->columnNames[$index]); } } $this->builder = $this->builder->addSelect(new raw(implode(', ', $rawSelect)));