ignore id on fallback

This commit is contained in:
2023-05-08 21:45:27 +10:00
parent 96bd56a828
commit 645b623a40

View File

@@ -85,7 +85,7 @@ class Uniqueish implements Rule
foreach ($results as $result) {
$resultValue = preg_replace('/[^A-Za-z0-9]/', '', strtolower($result->{$columnName}));
if ($resultValue === $similarValue) {
if ($resultValue === $similarValue && $result->id != $this->ignoreId) {
return false; // Value already exists in the table
}
}