<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ProductVariant extends Model
{
    protected $fillable = [
        'woo_id',
        'product_id', 'attribute_id', 'image', 'image_alt', 'name', 'color', 'show_in_specs',
        'price', 'discount_price', 'weight',
        'length', 'width', 'height',
        'stock', 'is_active', 'is_default', 'sort_order',
    ];

    protected $casts = [
        'show_in_specs' => 'boolean',
        'is_active'     => 'boolean',
        'is_default'    => 'boolean',
    ];

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