Laravel - Migrations - Dropping Columns
To drop a column, you may use the dropColumn
method on the schema builder blueprint. If your application is utilizing an SQLite database, you must install the doctrine/dbal
package via the Composer package manager before the dropColumn
method may be used:
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('votes');
});
You may drop multiple columns from a table by passing an array of column names to the dropColumn
method:
Schema::table('users', function (Blueprint $table) {
$table->dropColumn(['votes', 'avatar', 'location']);
});
Dropping or modifying multiple columns within a single migration while using an SQLite database is not supported.