<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\Pivot;
class OrderProduct extends Pivot
{
public $incrementing = true;
public $timestamps = false;
public function option()
{
return $this->belongsTo(Option::class);
}
public function optionValue()
{
return $this->belongsTo(OptionValue::class, 'value_id');
}
public function product()
{
return $this->belongsTo(Product::class)->withDefault();
}
}