From ba2f2e6f4e0ed0c53362d286c7b021f893dd15b6 Mon Sep 17 00:00:00 2001 From: Muhajirin Ilyas Date: Sun, 4 Dec 2022 00:37:13 +0700 Subject: [PATCH] use hash column name instead of attribute --- src/Rules/ExistsByHash.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rules/ExistsByHash.php b/src/Rules/ExistsByHash.php index 4a38d47..f8548fd 100644 --- a/src/Rules/ExistsByHash.php +++ b/src/Rules/ExistsByHash.php @@ -34,7 +34,7 @@ public function passes($attribute, $value) $model = new $this->model(); if ($model->shouldHashPersist()) { - return $model->newQuery()->where($attribute, $value)->count() > 0; + return $model->newQuery()->where($model->getHashColumnName(), $value)->count() > 0; } return $model->newQuery()->where($model->getKeyName(), $this->model::hashToId($value))->count() > 0;