Набор миграции Laravel Set Значение по умолчанию
$table->string('name')->default('Hello World!');
Faithful Fish
$table->string('name')->default('Hello World!');
$table->increments('id');
$table->string('name');
$table->string('url');
$table->string('country');
$table->tinyInteger('status')->default('1');
$table->timestamps();
Schema::table('users', function ($table) {
$table->integer('active')->default(0)->change();
});
$table->integer('parent_item_category_id')->nullable();
Schema::table('users', function ($table) {
$table->integer('active')->default(0)->change();
});
You can use change() method:
Schema::table('users', function ($table) {
$table->integer('active')->default(0)->change();
});