<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class productQuotationDetails extends BaseModel
{
    use HasFactory;

    protected $fillable = [
        'product_quotation_master_id', 'product_id', 'attribute_id', 'product_name', 'quantity', 'unit_price', 'tax', 'vat', 'total',
    ];

    public function productQuotationMaster()
    {
        return $this->belongsTo(productQuotationMaster::class, 'product_quotation_master_id');
    }

    public function product()
    {
        return $this->belongsTo(Product::class, 'product_id');
    }

    public function attribute()
    {
        return $this->belongsTo(productAttribute::class, 'attribute_id')->with('color', 'unit', 'brand', 'origin', 'product');
    }
}
