From 915e190a31b64e3fa719fb0ab6ff1131076239a1 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Mon, 14 Nov 2016 18:38:14 +0000 Subject: [PATCH] Use system getTablePrefix --- app/Repositories/Metric/AbstractMetricRepository.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/Repositories/Metric/AbstractMetricRepository.php b/app/Repositories/Metric/AbstractMetricRepository.php index 1cd8c985..f63f3e0f 100644 --- a/app/Repositories/Metric/AbstractMetricRepository.php +++ b/app/Repositories/Metric/AbstractMetricRepository.php @@ -11,6 +11,7 @@ namespace CachetHQ\Cachet\Repositories\Metric; +use CachetHQ\Cachet\Integrations\Contracts\System; use CachetHQ\Cachet\Models\Metric; use Illuminate\Contracts\Config\Repository; use Illuminate\Support\Collection; @@ -55,9 +56,7 @@ abstract class AbstractMetricRepository */ protected function getMetricsTable() { - $driver = $this->config->get('database.default'); - $connection = $this->config->get('database.connections.'.$driver); - $prefix = $connection['prefix']; + $prefix = app(System::class)->getTablePrefix(); return $prefix.'metrics'; } @@ -69,9 +68,7 @@ abstract class AbstractMetricRepository */ protected function getMetricPointsTable() { - $driver = $this->config->get('database.default'); - $connection = $this->config->get('database.connections.'.$driver); - $prefix = $connection['prefix']; + $prefix = app(System::class)->getTablePrefix(); return $prefix.'metric_points'; }