implementasi provider online

This commit is contained in:
2026-05-13 13:16:58 +07:00
parent a4a48014e1
commit 2ae565cfa5
5 changed files with 766 additions and 1 deletions

View File

@@ -0,0 +1,54 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::table('providers', function (Blueprint $table) {
if (!Schema::hasColumn('providers', 'token')) {
$table->string('token')->nullable()->after('header_token');
}
});
Schema::table('request_logs', function (Blueprint $table) {
if (!Schema::hasColumn('request_logs', 'nomor_sep')) {
$table->string('nomor_sep')->nullable()->after('invoice_no');
}
if (!Schema::hasColumn('request_logs', 'inacbgs_code')) {
$table->string('inacbgs_code')->nullable()->after('nomor_sep');
}
if (!Schema::hasColumn('request_logs', 'inacbgs_amount')) {
$table->integer('inacbgs_amount')->default(0)->after('inacbgs_code');
}
if (!Schema::hasColumn('request_logs', 'no_transaksi_provider')) {
$table->string('no_transaksi_provider')->nullable()->after('inacbgs_amount');
}
});
}
public function down()
{
Schema::table('providers', function (Blueprint $table) {
if (Schema::hasColumn('providers', 'token')) {
$table->dropColumn('token');
}
});
Schema::table('request_logs', function (Blueprint $table) {
$dropColumns = [];
foreach (['nomor_sep', 'inacbgs_code', 'inacbgs_amount', 'no_transaksi_provider'] as $col) {
if (Schema::hasColumn('request_logs', $col)) {
$dropColumns[] = $col;
}
}
if (!empty($dropColumns)) {
$table->dropColumn($dropColumns);
}
});
}
};