Skip to content

Commit

Permalink
fix search with comma
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Mar 21, 2024
1 parent 99866c7 commit 011d79b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/Http/Filters/SearchFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@

use Illuminate\Database\Eloquent\Builder;
use Spatie\QueryBuilder\Filters\Filter;
use function JmesPath\search;

class SearchFilter implements Filter
{
public function __invoke(Builder $query, $term, string $property): void
{
if(is_array($term))
{
$term = implode(',', $term);
}
if (\is_array($term)) {
$term = implode(',', $term);
}
$query->search($term);
}
}

0 comments on commit 011d79b

Please sign in to comment.