Add custom fields to JenisLegalitasJaminan

Added `custom_field` and `custom_field_type` columns to the `jenis_legalitas_jaminan` table. Updated model, migration, and request files to handle these new fields, ensuring they are optional and have a maximum length of 255 characters.
This commit is contained in:
Daeng Deni Mardaeni
2024-11-04 15:59:59 +07:00
parent 2908a21454
commit ec6cb8e09f
4 changed files with 116 additions and 52 deletions

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('jenis_legalitas_jaminan', function (Blueprint $table) {
$table->string('custom_field')->nullable()->after('slug');
$table->string('custom_field_type')->nullable()->after('custom_field');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('jenis_legalitas_jaminan', function (Blueprint $table) {
$table->dropColumn('custom_field');
$table->dropColumn('custom_field_type');
});
}
};