feat: mandatory IC scan upload on customer register and customer_info

This commit is contained in:
2026-10-27 13:28:49 +08:00
parent 0451ad3dbe
commit 1debb30751
4 changed files with 249 additions and 7 deletions
@@ -0,0 +1,46 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddScanIcToCustomerTable extends Migration
{
/**
* Master DB (mysql7) — stores arrahn_files.id for the scanned IC document.
*
* @return void
*/
public function up()
{
if (
Schema::connection('mysql7')->hasTable('customer')
&& !Schema::connection('mysql7')->hasColumn('customer', 'scan_ic')
) {
Schema::connection('mysql7')->table('customer', function (Blueprint $table) {
if (Schema::connection('mysql7')->hasColumn('customer', 'gambar_mykad')) {
$table->unsignedBigInteger('scan_ic')->nullable()->after('gambar_mykad');
} else {
$table->unsignedBigInteger('scan_ic')->nullable();
}
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
if (
Schema::connection('mysql7')->hasTable('customer')
&& Schema::connection('mysql7')->hasColumn('customer', 'scan_ic')
) {
Schema::connection('mysql7')->table('customer', function (Blueprint $table) {
$table->dropColumn('scan_ic');
});
}
}
}