Skip to content

Commit

Permalink
Update Searching.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Torann authored Feb 2, 2024
1 parent 7dccd85 commit 54eae28
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Concerns/Searching.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 54eae28

Please sign in to comment.