getDoctrineSchemaManager(); $pages = $sm->listTableDetails('pages'); $books = $sm->listTableDetails('books'); $chapters = $sm->listTableDetails('chapters'); if ($pages->hasIndex('name_search')) { Schema::table('pages', function (Blueprint $table) { $table->dropIndex('name_search'); }); } if ($books->hasIndex('name_search')) { Schema::table('books', function (Blueprint $table) { $table->dropIndex('name_search'); }); } if ($chapters->hasIndex('name_search')) { Schema::table('chapters', function (Blueprint $table) { $table->dropIndex('name_search'); }); } } };