fix: broken search

This commit is contained in:
Phan An 2024-10-17 22:04:51 +07:00
parent 387b937820
commit bd246c37dd
2 changed files with 2 additions and 2 deletions

View file

@ -15,7 +15,7 @@ use Illuminate\Support\Collection;
abstract class Repository implements RepositoryInterface
{
/** @var class-string<T> $modelClass */
protected string $modelClass;
public string $modelClass;
protected Guard $auth;

View file

@ -52,7 +52,7 @@ class SearchService
{
try {
return $repository->getMany(
ids: $repository->model::search($keywords)->get()->take($count)->pluck('id')->all(), // @phpstan-ignore-line
ids: $repository->modelClass::search($keywords)->get()->take($count)->pluck('id')->all(), // @phpstan-ignore-line
preserveOrder: true,
);
} catch (Throwable $e) {