<?php

namespace App\Models;

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

class MiscIssueItem extends Model
{
    use HasFactory;

    protected $table = 'misc_issue_items';

    protected $fillable = [
        'misc_issue_id',
        'item_id',
        'quantity',
        'item_code_snapshot',
        'item_name_snapshot',
    ];

    public function miscIssue()
    {
        return $this->belongsTo(MiscIssue::class, 'misc_issue_id', 'id');
    }

    public function item()
    {
        return $this->belongsTo(Item::class, 'item_id', 'id');
    }
}
