File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,11 @@ public function handle(Dispatcher $events)
34
34
$ class = $ this ->argument ('model ' );
35
35
36
36
$ model = new $ class ();
37
- $ tnt = new TNTSearch ();
37
+ $ tnt = new TNTSearch ();
38
38
$ driver = $ model ->getConnectionName () ?: config ('database.default ' );
39
39
$ config = config ('scout.tntsearch ' ) + config ("database.connections. $ driver " );
40
+ $ tablePrefix = $ config ['prefix ' ] ?? '' ;
41
+ $ tableName = $ tablePrefix .$ model ->getTable ();
40
42
41
43
$ tnt ->loadConfig ($ config );
42
44
$ tnt ->setDatabaseHandle (app ('db ' )->connection ($ driver )->getPdo ());
@@ -55,7 +57,7 @@ public function handle(Dispatcher $events)
55
57
$ query = '* ' ;
56
58
}
57
59
58
- $ indexer ->query ("SELECT $ query FROM {$ model -> getTable () }; " );
60
+ $ indexer ->query ("SELECT $ query FROM {$ tableName }; " );
59
61
60
62
$ indexer ->run ();
61
63
$ this ->info ('All [ ' .$ class .'] records have been imported. ' );
You can’t perform that action at this time.
0 commit comments