add kolom active

This commit is contained in:
2023-10-27 13:57:24 +07:00
parent 495a73770e
commit 239e95f5df
2 changed files with 33 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ class FormulariumTemplate extends Model
protected $fillable = [
'name',
'description',
'active',
];
protected $hidden = [

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('formularium_templates', function (Blueprint $table) {
$table->tinyInteger('active')->default(1)->after('description');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('formularium_templates', function (Blueprint $table) {
$table->dropColumn('active');
});
}
};