Skip to content

Commit

Permalink
fix(core): respect table prefix config in search index (#1931)
Browse files Browse the repository at this point in the history
It might not be crucial for things to work. But, from its appearance,
it's supposed to strip the table prefix from the model's table. So,
updated the code to make it behave as intended.

Co-authored-by: Glenn Jacobs <[email protected]>
  • Loading branch information
yusufkandemir and glennjacobs authored Nov 19, 2024
1 parent fd3008b commit 62c41ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/Search/ScoutIndexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 62c41ee

Please sign in to comment.