Indexes: Dropping Indexes

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

To drop an index, you must specify the index's name.

By default, Laravel automatically assigns a reasonable name to the indexes.

  • $table->dropPrimary('users_id_primary');.
  • $table->dropUnique('users_email_unique');.
  • $table->dropIndex('geo_state_index');.
  • $table->dropSpatialIndex('geo_location_spatialindex');.

Related concepts

Indexes: Dropping Indexes — Structure map

Clickable & Draggable!

Indexes: Dropping Indexes — Related pages: