<?php

namespace App\Models;

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

class CompanyInventory extends Model
{
    use HasFactory;
    protected $guarded = ['id'];

    /**AN Entry in this Table was created by a Specific user**/
    public function user()
    {
        return $this->belongsTo(User::class, 'created_by');
    }

    /**An Item has many usage in Bill Master Table**/
    public function itemInventory()
    {
        return $this->hasMany(BillMasterCompanyInventory::class, 'item_id');
    }

    /**An Item has many usage in Bill Master Table Old**/
    public function itemOldInventory()
    {
        return $this->hasMany(BillMasterCompanyOldInventory::class, 'item_id');
    }
}
