Files
qds/app/Models/Item.php
dhanabalan b0e2e9fe04
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Successful in 19s
Laravel Larastan / larastan (pull_request) Failing after 3m51s
Laravel Pint / pint (pull_request) Failing after 3m49s
Added item and plant models
2025-12-23 17:49:07 +05:30

52 lines
1.0 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class Item extends Model
{
use SoftDeletes;
protected $fillable = [
'plant_id',
'category',
'code',
'description',
'hourly_quantity',
'uom',
];
public function plant(): BelongsTo
{
return $this->belongsTo(Plant::class);
}
public function stickerMasters()
{
return $this->hasMany(StickerMaster::class, 'item_id', 'id');
}
public function productionQuantities()
{
return $this->hasMany(ProductionQuantity::class);
}
public function motorTestingMasters()
{
return $this->hasMany(MotorTestingMaster::class);
}
public function testingPanelReadings()
{
return $this->hasMany(TestingPanelReading::class);
}
public function itemCharacteristics()
{
return $this->hasMany(ItemCharacteristic::class, 'item_id', 'id');
}
}