Files
mareike/app/RelationModels/EventParticipationFee.php

26 lines
694 B
PHP

<?php
namespace App\RelationModels;
use App\Casts\AmountCast;
use App\Enumerations\ParticipationFeeType;
use App\Models\Tenant;
use App\Scopes\CommonModel;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class EventParticipationFee extends CommonModel
{
protected $table = 'event_participation_fees';
protected $fillable = ['tenant', 'type', 'name', 'description', 'amount'];
protected $casts = ['amount' => AmountCast::class];
public function tenant() : BelongsTo {
return $this->belongsTo(Tenant::class, 'tenant', 'slug');
}
public function type() : BelongsTo {
return $this->belongsTo(ParticipationFeeType::class, 'type', 'slug');
}
}