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)
3434 $ class = $ this ->argument ('model ' );
3535
3636 $ model = new $ class ();
37- $ tnt = new TNTSearch ();
37+ $ tnt = new TNTSearch ();
3838 $ driver = $ model ->getConnectionName () ?: config ('database.default ' );
3939 $ config = config ('scout.tntsearch ' ) + config ("database.connections. $ driver " );
40+ $ tablePrefix = $ config ['prefix ' ] ?? '' ;
41+ $ tableName = $ tablePrefix .$ model ->getTable ();
4042
4143 $ tnt ->loadConfig ($ config );
4244 $ tnt ->setDatabaseHandle (app ('db ' )->connection ($ driver )->getPdo ());
@@ -55,7 +57,7 @@ public function handle(Dispatcher $events)
5557 $ query = '* ' ;
5658 }
5759
58- $ indexer ->query ("SELECT $ query FROM {$ model -> getTable () }; " );
60+ $ indexer ->query ("SELECT $ query FROM {$ tableName }; " );
5961
6062 $ indexer ->run ();
6163 $ this ->info ('All [ ' .$ class .'] records have been imported. ' );
You can’t perform that action at this time.
0 commit comments