From 1e455088f36c60676a094d6e1bb70069a20ae2f8 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Sat, 28 Feb 2026 10:06:46 +0530 Subject: [PATCH] Updated hasMany relationship on Plant model --- app/Models/Plant.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/Models/Plant.php b/app/Models/Plant.php index ce7cabc..c88940e 100644 --- a/app/Models/Plant.php +++ b/app/Models/Plant.php @@ -25,12 +25,12 @@ class Plant extends Model public function blocks(): HasMany { - return $this->hasMany(Block::class); + return $this->hasMany(Block::class, 'plant_id', 'id'); } public function lines(): HasMany { - return $this->hasMany(Line::class); + return $this->hasMany(Line::class, 'plant_id', 'id'); } public function getLineNames() @@ -40,27 +40,27 @@ class Plant extends Model public function items(): HasMany { - return $this->hasMany(Item::class); + return $this->hasMany(Item::class, 'plant_id', 'id'); } public function stickersMasters(): HasMany { - return $this->hasMany(StickerMaster::class); + return $this->hasMany(StickerMaster::class, 'plant_id', 'id'); } public function invoiceValidations() { - return $this->hasMany(InvoiceValidation::class, 'plant_id'); + return $this->hasMany(InvoiceValidation::class, 'plant_id', 'id'); } public function qualityValidations() { - return $this->hasMany(QualityValidation::class, 'plant_id'); + return $this->hasMany(QualityValidation::class, 'plant_id', 'id'); } public function testingPanelReadings() { - return $this->hasMany(TestingPanelReading::class); + return $this->hasMany(TestingPanelReading::class, 'plant_id', 'id'); } public function guardNames() @@ -95,12 +95,12 @@ class Plant extends Model public function productCharacteristicsMasters() { - return $this->hasMany(ProductCharacteristicsMaster::class); + return $this->hasMany(ProductCharacteristicsMaster::class, 'plant_id', 'id'); } public function characteristicValues() { - return $this->hasMany(CharacteristicValue::class); + return $this->hasMany(CharacteristicValue::class, 'plant_id', 'id'); } public function equipmentMasters() -- 2.49.1