Skip to content

Commit

Permalink
Merge pull request #34 from muhajirinlpu/patch-1
Browse files Browse the repository at this point in the history
use hash column name instead of attribute
  • Loading branch information
veelasky authored Dec 3, 2022
2 parents d54c5e1 + ba2f2e6 commit 50eaf74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Rules/ExistsByHash.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 50eaf74

Please sign in to comment.