Refactor Plant model to ensure proper formatting and maintain consistency in method definitions

This commit is contained in:
dhanabalan
2025-09-29 12:33:13 +05:30
parent 168e9266fe
commit a4afe2f3c7

View File

@@ -34,9 +34,9 @@ class Plant extends Model
} }
public function getLineNames() 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 public function items(): HasMany
{ {
@@ -97,4 +97,9 @@ class Plant extends Model
// { // {
// return $this->hasMany(RejectReason::class, 'plant_id', 'id'); // return $this->hasMany(RejectReason::class, 'plant_id', 'id');
// } // }
public function users()
{
return $this->hasMany(User::class, 'plant_id', 'id');
}
} }