أُنشئ من Tokal/Test
43 أسطر
855 B
PHP
43 أسطر
855 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
class ReservationFee extends Model
|
|
{
|
|
use HasFactory;
|
|
public $timestamps = false;
|
|
|
|
protected $fillable = [
|
|
'reservation_id',
|
|
'pricing_rule_id',
|
|
'price_per_person',
|
|
'party_size',
|
|
'total_fee',
|
|
'total_amount',
|
|
'currency',
|
|
];
|
|
|
|
public function setTotalAmountAttribute($value): void
|
|
{
|
|
$this->attributes['total_fee'] = $value;
|
|
}
|
|
|
|
public function getTotalAmountAttribute()
|
|
{
|
|
return $this->attributes['total_fee'] ?? null;
|
|
}
|
|
|
|
public function reservation()
|
|
{
|
|
return $this->belongsTo(Reservation::class);
|
|
}
|
|
|
|
public function pricingRule()
|
|
{
|
|
return $this->belongsTo(PricingRule::class);
|
|
}
|
|
}
|