Schema::connection('')->table($tableName, function (Blueprint $table) {
            $sm = Schema::getConnection()->getDoctrineSchemaManager();
            $indexesFound = $sm->listTableIndexes('table');

            if(array_key_exists("index_name", $indexesFound))
                $table->dropUnique("index_name");
        });

 

相关文章: