<?php

namespace Mamad\Product\Models;

use Illuminate\Database\Eloquent\Model;
use Mamad\Category\Models\Category;
use Mamad\Media\Service\MediaService;
use Mamad\PostMeta\Models\Post_meta;
use Mamad\PostMeta\Repository\PostMetaRepository;
use Mamad\ProductAttr\Models\Attribute;

class ProductAttribute extends Model
{
    protected $table="product_attribute";
    protected $fillable=["attribute_id","product_id","values","use_in_product","use_in_variable"];
    protected $casts=["values"=>"json"];
    public function attribute()
    {
        return $this->belongsTo(Attribute::class,"attribute_id");
    }
    public function product()
{
    return $this->belongsToMany(Product::class,"product_attribute");
}
}
