From e159006fa75ebcf2cc4f569863c6e0703a65c6bd Mon Sep 17 00:00:00 2001 From: Yusuf Kandemir Date: Sun, 1 Sep 2024 23:13:39 +0300 Subject: [PATCH] fix(core): respect table prefix config in search index --- packages/core/src/Search/ScoutIndexer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/src/Search/ScoutIndexer.php b/packages/core/src/Search/ScoutIndexer.php index 89decd3af2..d0552057de 100644 --- a/packages/core/src/Search/ScoutIndexer.php +++ b/packages/core/src/Search/ScoutIndexer.php @@ -12,7 +12,8 @@ class ScoutIndexer implements ScoutIndexerInterface { public function searchableAs(Model $model): string { - $name = str_replace('lunar_', '', $model->getTable()); + $tablePrefix = config('lunar.database.table_prefix'); + $name = str_replace($tablePrefix, '', $model->getTable()); return config('scout.prefix').$name; }