Handling of event addons

This commit is contained in:
2026-08-12 17:18:45 +02:00
parent 085299336e
commit 6e4e6b645c
74 changed files with 3072 additions and 95 deletions
+41
View File
@@ -0,0 +1,41 @@
<?php
namespace App\Models;
use App\Casts\AmountCast;
use App\Scopes\InstancedModel;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class EventParticipantAddon extends InstancedModel
{
protected $table = 'event_participant_addons';
protected $fillable = [
'tenant',
'event_id',
'event_participant_id',
'addon_key',
'title',
'price',
'flat',
'days',
'amount',
];
protected $casts = [
'flat' => 'boolean',
'days' => 'integer',
'price' => AmountCast::class,
'amount' => AmountCast::class,
];
public function event(): BelongsTo
{
return $this->belongsTo(Event::class);
}
public function participant(): BelongsTo
{
return $this->belongsTo(EventParticipant::class, 'event_participant_id');
}
}