Added workGroupMaster foreignKey and belongsTo relationship to Machine model

This commit is contained in:
dhanabalan
2025-09-15 12:20:59 +05:30
parent db3a69d47f
commit 55c0ebfa6d

View File

@@ -13,6 +13,7 @@ class Machine extends Model
protected $fillable = [ protected $fillable = [
'plant_id', 'plant_id',
'line_id', 'line_id',
'work_group_master_id',
'name', 'name',
'work_center', 'work_center',
]; ];
@@ -27,6 +28,11 @@ class Machine extends Model
return $this->belongsTo(Line::class); return $this->belongsTo(Line::class);
} }
public function workGroupMaster(): BelongsTo
{
return $this->belongsTo(WorkGroupMaster::class);
}
public function testingPanelReadings() public function testingPanelReadings()
{ {
return $this->hasMany(TestingPanelReading::class); return $this->hasMany(TestingPanelReading::class);