<?php

namespace App\Models;

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

class PurchaseMaker extends BaseModel
{
    use HasFactory;

    protected $guarded = [];

    public function product_info()
    {
        return $this->hasOne(Product::class, 'id', 'product_id');
    }

    public function productAttribute()
    {
        return $this->hasOne(productAttribute::class, 'id', 'attribute_id')
            ->with([
                'warehouse',
                'shopWarehouse',
                'unit',
                'category',
                'product',
                'productType',
                'size',
                'color',
                'model',
                'brand',
                'origin',
                'goldUnit',
                'diamondUnit',
            ]);
    }
}
