<?php

namespace Modules\Order\Models;

use Illuminate\Database\Eloquent\Model;
use Modules\Attribute\Models\Attribute;
use Modules\Product\Models\Product;

class Cart extends Model
{
    public $timestamps = false;
    protected $fillable =
    [
        'status','count','product_id','main_attribute_id','sub_attribute_id','user_id'
    ];

    public function product()
    {
        return $this->belongsTo(Product::class)->withTrashed();
    }
    public function mainAttr()
    {
        return $this->belongsTo(Attribute::class,'main_attribute_id')->withTrashed();
    }
    public function subAttr()
    {
        return $this->belongsTo(Attribute::class,'sub_attribute_id')->withTrashed();
    }
}
