1public function up()
2{
3 Schema::table('table', function($table) {
4 $table->dropColumn('column_name');
5 });
6}
1// To drop a column, use the dropColumn method on the schema builder.
2// Before dropping columns from a SQLite database, you will need to add
3// the doctrine/dbal dependency to your composer.json file and run the
4// composer update command in your terminal to install the library:
5
6Schema::table('users', function (Blueprint $table) {
7 $table->dropColumn('votes');
8});
1 Class RemoveCommentViewCount extends Migration
2 {
3 public function up()
4 {
5 Schema::table('articles', function($table) {
6 $table->dropColumn('comment_count');
7 $table->dropColumn('view_count');
8 });
9 }
10
11 public function down()
12 {
13 Schema::table('articles', function($table) {
14 $table->integer('comment_count');
15 $table->integer('view_count');
16 });
17 }
18 }
1// Searched, laravel drop foreign column
2Schema::table('users', function (Blueprint $table) {
3 $table->dropColumn(['votes', 'avatar', 'location']);
4});