From a4afe2f3c7595c2c25de0b964a24e20a9bac82b6 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Mon, 29 Sep 2025 12:33:13 +0530 Subject: [PATCH] Refactor Plant model to ensure proper formatting and maintain consistency in method definitions --- app/Models/Plant.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Models/Plant.php b/app/Models/Plant.php index 167466a..19896e4 100644 --- a/app/Models/Plant.php +++ b/app/Models/Plant.php @@ -34,9 +34,9 @@ class Plant extends Model } public function getLineNames() - { - return $this->hasMany(Line::class, 'plant_id', 'id'); // Ensure 'plant_id' is the foreign key in 'lines' table - } + { + return $this->hasMany(Line::class, 'plant_id', 'id'); + } public function items(): HasMany { @@ -97,4 +97,9 @@ class Plant extends Model // { // return $this->hasMany(RejectReason::class, 'plant_id', 'id'); // } + + public function users() + { + return $this->hasMany(User::class, 'plant_id', 'id'); + } }