drop foreign key laravel migration code example
Example 1: larael drop foreign key
Schema::table('posts', function (Blueprint $table) {
$table->dropForeign(['category_id']);
});
Example 2: laravel remove foreign key
$table->dropForeign('posts_user_id_foreign');
Example 3: laravel drop table migration
Schema::drop('users');
Schema::dropIfExists('users');
Example 4: laravel migration drop foreign keys
$table->dropIndex(['state']); // Drops index 'geo_state_index'