<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class OrderItems extends Model
{
    protected $fillable = [
        'order_id',      // ← ADD THIS
        'product_id',
        'quantity',
        'price',
        'total_price',
        'custom_fields', // if using
    ];

       protected $casts = [
        'custom_fields' => 'array',
    ];
      public function product()
    {
        return $this->belongsTo(Products::class);
    }
}
