From 9ed02c8b1913bcff606ef699be2238c15d12c466 Mon Sep 17 00:00:00 2001 From: pascalbaljet Date: Tue, 11 Jun 2019 14:58:50 +0200 Subject: [PATCH] Using whereColumn instead of groupBy --- src/HasStatuses.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HasStatuses.php b/src/HasStatuses.php index 3dce3a3..c9a9896 100644 --- a/src/HasStatuses.php +++ b/src/HasStatuses.php @@ -72,7 +72,7 @@ function (QueryBuilder $query) { ->select(DB::raw('max(id)')) ->from($this->getStatusTableName()) ->where('model_type', $this->getStatusModelType()) - ->groupBy($this->getModelKeyColumnName()); + ->whereColumn($this->getModelKeyColumnName(), $this->getQualifiedKeyName()); } ); } @@ -100,7 +100,7 @@ function (QueryBuilder $query) use ($names) { ->select(DB::raw('max(id)')) ->from($this->getStatusTableName()) ->where('model_type', $this->getStatusModelType()) - ->groupBy($this->getModelKeyColumnName()); + ->whereColumn($this->getModelKeyColumnName(), $this->getQualifiedKeyName()); } ); }