Files
Kol-Manager/app/Models/InvoiceItem.php

26 lines
612 B
PHP

<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class InvoiceItem extends Model
{
protected $fillable = ['invoice_id', 'description', 'quantity', 'unit_price', 'total', 'is_taxable', 'is_discountable'];
protected $casts = [
'unit_price' => 'decimal:2',
'total' => 'decimal:2',
'is_taxable' => 'boolean',
'is_discountable' => 'boolean',
];
public function invoice(): BelongsTo
{
return $this->belongsTo(Invoice::class);
}
}