mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
- the search filters were not emptied between requests resulting in wrong search results when searching anime/manga
27 lines
736 B
PHP
27 lines
736 B
PHP
<?php
|
|
|
|
namespace App\Support;
|
|
|
|
use App\Contracts\RepositoryQuery as RepositoryQueryContract;
|
|
use Illuminate\Contracts\Database\Query\Builder;
|
|
use Illuminate\Support\Collection;
|
|
use Laravel\Scout\Builder as ScoutBuilder;
|
|
|
|
class RepositoryQuery extends RepositoryQueryBase implements RepositoryQueryContract
|
|
{
|
|
public function filter(Collection $params): Builder|ScoutBuilder
|
|
{
|
|
return $this->queryable()->filter($params);
|
|
}
|
|
|
|
public function search(string $keywords, ?\Closure $callback = null): ScoutBuilder
|
|
{
|
|
return $this->searchable($keywords, $callback, true);
|
|
}
|
|
|
|
public function where(string $key, mixed $value): Builder
|
|
{
|
|
return $this->queryable()->where($key, $value);
|
|
}
|
|
}
|