Files
einundzwanzig-verein/app/Models/EinundzwanzigPleb.php
fsociety 0bdd890dd3 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
2024-09-30 15:14:50 +02:00

31 lines
528 B
PHP

<?php
namespace App\Models;
use App\Enums\AssociationStatus;
use Illuminate\Database\Eloquent\Model;
class EinundzwanzigPleb extends Model
{
protected $guarded = [];
protected function casts(): array
{
return [
'association_status' => AssociationStatus::class,
];
}
public function profile()
{
return $this->hasOne(Profile::class, 'pubkey', 'pubkey');
}
public function paymentEvents()
{
return $this->hasMany(PaymentEvent::class);
}
}