Всем привет. Не могу понять почему код ниже приводит к ошибке:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'order_id' cannot be null
$orderProduct = new OrderProduct([
'order_id' => $order->id,
'product_id' => $cartProduct->id,
'product_options' => json_encode($productOption)
]);
$this->orderProducts()->save($orderProduct);
fillable в модели OrderProduct
protected $fillable = [
'order_id',
'product_id',
'product_options',
];
В чем может быть причина такой ошибки?