<?php

namespace App;

use App\Traits\ModelTimeFormat;
use Illuminate\Database\Eloquent\Model;

class OrderPackageCommodities extends Model
{
    //
    use ModelTimeFormat;

    /*
     * amount => OracleActAllocationDetails->qty_each
     */
    protected $fillable = [
        'order_package_id','commodity_id','amount'
    ];


    public function package(){
        return $this->belongsTo(OrderPackage::class,'order_package_id','id');
    }

    public function commodity(){
        return $this->belongsTo(Commodity::class,'commodity_id','id');
    }

    public function orderTracking(){
        return $this->belongsTo(OrderTracking::class,'id','order_package_commodity_id');
    }

}
