From 3d139c005a54bc37e6487aac1999b8a0db0b7d55 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Mon, 16 Mar 2026 19:23:09 +0530 Subject: [PATCH] Added hasMany relationship on model files --- app/Models/Item.php | 5 +++++ app/Models/Machine.php | 5 +++++ app/Models/Plant.php | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/app/Models/Item.php b/app/Models/Item.php index 733e359..c4ebc33 100644 --- a/app/Models/Item.php +++ b/app/Models/Item.php @@ -64,6 +64,11 @@ class Item extends Model return $this->hasMany(CharacteristicValue::class); } + public function ClassCharacteristics() + { + return $this->hasMany(ClassCharacteristic::class, 'item_id', 'id'); + } + public function weightValidations() { return $this->hasMany(WeightValidation::class); diff --git a/app/Models/Machine.php b/app/Models/Machine.php index a6c3665..a6e4e33 100644 --- a/app/Models/Machine.php +++ b/app/Models/Machine.php @@ -43,6 +43,11 @@ class Machine extends Model return $this->hasMany(CharacteristicValue::class); } + public function ClassCharacteristics() + { + return $this->hasMany(ClassCharacteristic::class, 'machine_id', 'id'); + } + public function testingPanelReadings() { return $this->hasMany(TestingPanelReading::class); diff --git a/app/Models/Plant.php b/app/Models/Plant.php index ca9bc27..5fad1f9 100644 --- a/app/Models/Plant.php +++ b/app/Models/Plant.php @@ -113,6 +113,11 @@ class Plant extends Model return $this->hasMany(EquipmentMaster::class, 'plant_id', 'id'); } + public function ClassCharacteristics() + { + return $this->hasMany(ClassCharacteristic::class, 'plant_id', 'id'); + } + // public function rejectReasons() // { // return $this->hasMany(RejectReason::class, 'plant_id', 'id');