<?php

namespace Modules\Order\Models;

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

class OrderProduct extends Model
{
    public $timestamps = false;
    protected $fillable =
        [
            'count','total','order_id','product_id','item_id'
        ];

    public function product()
    {
        return $this->belongsTo(Product::class)->withTrashed();
    }
    public function additions()
    {
        return $this->hasMany(OrderProductAddition::class);
    }
    public function item()
    {
        return $this->belongsTo(Item::class,'item_id');
    }
}
