laravel migration delete foreign key code example
Example 1: laravel remove foreign key
$table->dropForeign('posts_user_id_foreign');
Example 2: laravel drop foreign column
// Searched, laravel drop foreign column
Schema::table('users', function (Blueprint $table) {
$table->dropColumn(['votes', 'avatar', 'location']);
});
Example 3: laravel migration drop foreign keys
$table->dropPrimary('users_id_primary');
Example 4: laravel migration drop foreign keys
$table->dropIndex(['state']); // Drops index 'geo_state_index'