<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Item extends Model
{
    use HasFactory;

    protected $fillable = [
        'plans_id',
        'status',
        'cart_id',
        'labkit_delivery_status',
        'quantity',
        'note',
        'short_description'
    ];

    public function cart()
    {
        return $this->belongsTo(Cart::class);
    }
    public function plansV1()
    {
        return $this->belongsTo(PlanV1::class, 'plans_id');
    }
    public function itemHistories()
    {
        return $this->hasMany(ItemHistory::class, 'item_id');
    }
    public function labkitOrderItems()
    {
        return $this->hasMany(LabkitOrderItem::class);
    }
}
