<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class BoxProductVariant extends Model
{
    protected $table = 'box_product_variants';

    protected $primaryKey = 'id';

    protected $fillable = [
        'box_product_id','active_variant','price','discount','color','size'
    ];

    protected $with = ["boxProductImages"];

    public function box_product(){
        return $this->belongsTo("App\BoxProduct","box_product_id");
    }

    public function boxProductImages(){
        return $this->hasMany("App\BoxProductImage","box_product_variant_id");
    }

    public function box_order_lines(){
        return $this->hasOne("App\BoxOrderLine","box_order_line_id");
    }
}
