add payment option

This commit is contained in:
2025-10-02 18:35:02 +02:00
parent 0e0912c81b
commit 971a9e89d1
27 changed files with 1327 additions and 34 deletions
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
if (! Schema::hasTable('payments')) {
Schema::create('payments', function (Blueprint $table): void {
$table->id();
$table->foreignId('account_id')->constrained()->cascadeOnDelete();
$table->bigInteger('amount_cents');
$table->string('currency', 3)->default('EUR');
$table->string('reference')->nullable();
$table->timestamp('paid_at')->nullable();
$table->jsonb('meta')->nullable();
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamps();
$table->softDeletes();
$table->index(['account_id', 'paid_at']);
$table->index('reference');
});
}
}
public function down(): void
{
Schema::dropIfExists('payments');
}
};