From 645b623a40aeb7e7a689c185b213e0c31b34426c Mon Sep 17 00:00:00 2001 From: James Collins Date: Mon, 8 May 2023 21:45:27 +1000 Subject: [PATCH] ignore id on fallback --- app/Rules/Uniqueish.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Rules/Uniqueish.php b/app/Rules/Uniqueish.php index dd636e6..f6fb8a3 100644 --- a/app/Rules/Uniqueish.php +++ b/app/Rules/Uniqueish.php @@ -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 } }