topnotch_website/app/Models/EmbroideryEntry.php

39 lines
742 B
PHP
Raw Permalink Normal View History

2025-02-01 09:57:57 -08:00
<?php
namespace App\Models;
2025-02-01 09:57:57 -08:00
use Illuminate\Database\Eloquent\Factories\HasFactory;
2025-02-01 09:57:57 -08:00
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class EmbroideryEntry extends Model
{
2025-02-01 09:57:57 -08:00
use HasFactory;
2025-02-01 09:57:57 -08:00
protected $fillable = [
'quote_id',
'quantity',
'logo',
'width',
'height',
'placement',
2025-02-01 09:57:57 -08:00
'stitch_count',
2025-02-01 09:57:57 -08:00
'digitizing_cost',
'run_charge',
];
2025-02-01 09:57:57 -08:00
protected $appends = [
'total_price',
];
public function getTotalPriceAttribute(): float
{
return $this->digitizing_cost + $this->run_charge;
}
2025-02-01 09:57:57 -08:00
public function quote(): BelongsTo
{
return $this->belongsTo(Quote::class);
}
}