mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-13 05:26:47 +00:00
feat: add multiple payment events to user profile
- Added logic to handle multiple payment events in a user's profile - Created a new PaymentEvent model and associated it with the EinundzwanzigPleb model - Added a new migration for creating the payment_events table in the database - Updated the profile.blade.php view to display all payment events for a user
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?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_events', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('einundzwanzig_pleb_id');
|
||||
$table->foreign('einundzwanzig_pleb_id')->references('id')->on('einundzwanzig_plebs')->cascadeOnDelete();
|
||||
$table->unsignedInteger('year');
|
||||
$table->unsignedInteger('amount');
|
||||
$table->string('event_id', 255 * 2)->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::table('einundzwanzig_plebs', function (Blueprint $table) {
|
||||
$table->dropColumn('payment_event');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('payment_events');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user