Basic implementation of payment methods

This commit is contained in:
2026-07-28 15:50:58 +02:00
parent afc91545a9
commit 6c9281516e
39 changed files with 749 additions and 24 deletions
@@ -0,0 +1,38 @@
<?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('payment_methods', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('slug')->unique();
$table->timestamps();
});
Schema::create('available_payment_methods', function (Blueprint $table) {
$table->id();
$table->string('tenant');
$table->string('slug');
$table->string('name');
$table->string('description')->nullable();
$table->boolean('active')->default(true);
$table->timestamps();
$table->foreign('tenant')->references('slug')->on('tenants')->restrictOnDelete()->cascadeOnUpdate();
$table->foreign('slug')->references('slug')->on('payment_methods')->restrictOnDelete()->cascadeOnUpdate();
$table->unique(['tenant', 'slug']);
});
}
public function down(): void
{
Schema::dropIfExists('available_payment_methods');
Schema::dropIfExists('payment_methods');
}
};