diff --git a/src/Concerns/Searching.php b/src/Concerns/Searching.php index fa10b8a..f373c05 100644 --- a/src/Concerns/Searching.php +++ b/src/Concerns/Searching.php @@ -41,8 +41,10 @@ public function setSearchable(array|string $values, bool $safe = false): static } foreach ($values as $key => $value) { - if ($safe === true && isset($this->searchable[$key])) { - continue; + if ($safe === true) { + if (isset($this->searchable[$key]) || array_search($key, $this->searchable) !== false) { + continue; + } } $this->searchable[$key] = $value;