Added hasMany relations
This commit is contained in:
@@ -37,4 +37,24 @@ class Plant extends Model
|
|||||||
{
|
{
|
||||||
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'); // Ensure 'plant_id' is the foreign key in 'lines' table
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function items(): HasMany
|
||||||
|
{
|
||||||
|
return $this->hasMany(Item::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stickersMasters(): HasMany
|
||||||
|
{
|
||||||
|
return $this->hasMany(StickerMaster::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function invoiceValidations()
|
||||||
|
{
|
||||||
|
return $this->hasMany(InvoiceValidation::class, 'sticker_master_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function qualityValidations()
|
||||||
|
{
|
||||||
|
return $this->hasMany(QualityValidation::class, 'sticker_master_id');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user