laravel-rs/database/migrations/2025_04_27_080433_create_payments_table.php
Uchiha Bayu Senju 4654a2e350
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
Upload
2025-04-27 23:55:09 +07:00

35 lines
961 B
PHP

<?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::create('payments', function (Blueprint $table) {
$table->id();
$table->foreignId('registration_id')->constrained()->onDelete('cascade');
$table->decimal('total_amount', 10, 2);
$table->enum('payment_method', ['cash', 'transfer', 'insurance', 'bpjs']);
$table->string('insurance_provider')->nullable();
$table->string('insurance_number')->nullable();
$table->dateTime('payment_date');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('payments');
}
};