How to Remove Column from Table in Laravel Migration? (ok)
https://www.itsolutionstuff.com/post/how-to-remove-column-from-table-in-laravel-migrationexample.html
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePostsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::create('posts', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->text('body');
$table->boolean('is_publish')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('posts');
}
}


How to Remove Column from Table in Laravel Migration?
PreviousHow to Change Column Name and Data Type in Laravel Migration? (ok)NextHow to Change Table Name using Laravel Migration? (ok)
Last updated