Drop Unique Index Laravel

By official documentation You can see following:

If you pass an array of columns into a method that drops indexes, the
conventional index name will be generated based on the table name,
columns and key type:

Schema::table('geo', function ($table) {
    $table->dropIndex(['state']); // Drops index 'geo_state_index' 
});

You can drop it just simply using [] around field name:

Schema::table('guests', function(Blueprint $table)
{
    $table->dropUnique(['email']);
});

UPD: By the latest docs for 9.x it’s still relevant.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)