id(); $table->string('tenant'); $table->foreignId('event_id')->constrained('events', 'id')->cascadeOnDelete()->cascadeOnUpdate(); $table->foreignId('event_participant_id')->constrained('event_participants', 'id')->cascadeOnDelete()->cascadeOnUpdate(); // Der öffentliche Link. Eigener Token statt des Teilnehmer-Identifiers, damit ein Abbruch den // Link tötet, ohne andere per Identifier erreichbare Funktionen (GiroCode) mitzunehmen. $table->string('token', 32)->unique(); $table->string('status'); $table->float('amount', 2)->default(0); $table->string('reason')->nullable(); $table->text('reason_note')->nullable(); $table->string('account_owner')->nullable(); $table->string('account_iban')->nullable(); $table->foreignId('released_by')->nullable()->constrained('users', 'id')->nullOnDelete(); $table->dateTime('released_at')->nullable(); $table->dateTime('accepted_at')->nullable(); $table->dateTime('cancelled_at')->nullable(); $table->timestamps(); $table->foreign('tenant')->references('slug')->on('tenants')->restrictOnDelete()->cascadeOnUpdate(); $table->foreign('reason')->references('slug')->on('refund_reasons')->restrictOnDelete()->cascadeOnUpdate(); }); } public function down(): void { Schema::dropIfExists('participant_refunds'); } };