Laravel migración establecido valor predeterminado
$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();
});
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();
});