Skip to content

Commit

Permalink
Allow for arrays as a search value
Browse files Browse the repository at this point in the history
  • Loading branch information
lukereative authored May 20, 2024
1 parent 9faa891 commit 420831b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Extensions/DBFieldExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
class DBFieldExtension extends Extension
{

public function getSearchValue(): string
public function getSearchValue(): array|string
{
$value = $this->owner->getValue() ?? '';

if (is_array($value)) {
array_walk($value, fn($val) => preg_replace('/\s+/S', ' ', strip_tags($val)));

return $value;
}

return preg_replace('/\s+/S', ' ', strip_tags($value));
}

Expand Down

0 comments on commit 420831b

Please sign in to comment.