@@ -78,7 +78,7 @@ protected function createIndex()
7878 }
7979
8080 DB ::connection ($ this ->modelService ->connectionName )
81- ->statement ("CREATE FULLTEXT INDEX $ indexName ON $ tableName ( $ indexFields) " );
81+ ->statement ("CREATE FULLTEXT INDEX ` $ indexName` ON ` $ tableName` ($ indexFields) " );
8282
8383 event (new Events \ModelIndexCreated ($ indexName , $ indexFields ));
8484 }
@@ -89,7 +89,7 @@ protected function indexAlreadyExists()
8989 $ indexName = $ this ->modelService ->indexName ;
9090
9191 return !empty (DB ::connection ($ this ->modelService ->connectionName )->
92- select ("SHOW INDEX FROM $ tableName WHERE Key_name = ? " , [$ indexName ]));
92+ select ("SHOW INDEX FROM ` $ tableName` WHERE Key_name = ? " , [$ indexName ]));
9393 }
9494
9595 protected function indexNeedsUpdate ()
@@ -106,7 +106,7 @@ protected function getIndexFields()
106106 $ tableName = $ this ->modelService ->tablePrefixedName ;
107107
108108 $ index = DB ::connection ($ this ->modelService ->connectionName )->
109- select ("SHOW INDEX FROM $ tableName WHERE Key_name = ? " , [$ indexName ]);
109+ select ("SHOW INDEX FROM ` $ tableName` WHERE Key_name = ? " , [$ indexName ]);
110110
111111 $ indexFields = [];
112112
@@ -136,7 +136,7 @@ public function dropIndex()
136136
137137 if ($ this ->indexAlreadyExists ()) {
138138 DB ::connection ($ this ->modelService ->connectionName )
139- ->statement ("ALTER TABLE $ tableName DROP INDEX $ indexName " );
139+ ->statement ("ALTER TABLE ` $ tableName` DROP INDEX ` $ indexName` " );
140140 event (new Events \ModelIndexDropped ($ this ->modelService ->indexName ));
141141 }
142142 }
0 commit comments