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'); + } }