From c32e0dd7793590b305b65fd9244eaf9fdf991fea Mon Sep 17 00:00:00 2001 From: Iqbal Date: Tue, 5 May 2026 13:43:35 +0700 Subject: [PATCH] feat: add log_type column to request_logs table --- app/Models/RequestLog.php | 1 + ..._log_type_column_to_request_logs_table.php | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 database/migrations/2026_05_04_110554_add_log_type_column_to_request_logs_table.php diff --git a/app/Models/RequestLog.php b/app/Models/RequestLog.php index d415be4f..a0b25c53 100644 --- a/app/Models/RequestLog.php +++ b/app/Models/RequestLog.php @@ -57,6 +57,7 @@ class RequestLog extends Model 'type_of_member', 'nominal', 'approval_nominal_by', + 'log_type', ]; protected $hidden = [ diff --git a/database/migrations/2026_05_04_110554_add_log_type_column_to_request_logs_table.php b/database/migrations/2026_05_04_110554_add_log_type_column_to_request_logs_table.php new file mode 100644 index 00000000..41504927 --- /dev/null +++ b/database/migrations/2026_05_04_110554_add_log_type_column_to_request_logs_table.php @@ -0,0 +1,36 @@ +enum('log_type', ['reference', 'prescription', 'consultation'])->after('dppj')->nullable()->comment('Type of LOG: reference, prescription, or consultation'); + }); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + if(Schema::hasColumn('request_logs', 'log_type')) { + Schema::table('request_logs', function (Blueprint $table) { + $table->dropColumn('log_type'); + }); + } + } +};