Files
pds/app/Models/Machine.php
dhanabalan 62dcc122e8
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Laravel Pint / pint (pull_request) Successful in 3m6s
Laravel Larastan / larastan (pull_request) Failing after 4m52s
Added hasMany relation on model file
2026-02-26 22:39:24 +05:30

56 lines
1.1 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class Machine extends Model
{
use SoftDeletes;
protected $fillable = [
'plant_id',
'line_id',
'work_group_master_id',
'name',
'work_center',
];
public function plant(): BelongsTo
{
return $this->belongsTo(Plant::class);
}
public function line(): BelongsTo
{
return $this->belongsTo(Line::class);
}
public function workGroupMaster(): BelongsTo
{
return $this->belongsTo(WorkGroupMaster::class);
}
public function productCharacteristicsMasters()
{
return $this->hasMany(ProductCharacteristicsMaster::class);
}
public function characteristicValues()
{
return $this->hasMany(CharacteristicValue::class);
}
public function testingPanelReadings()
{
return $this->hasMany(TestingPanelReading::class);
}
public function equipmentMasters()
{
return $this->hasMany(EquipmentMaster::class, 'machine_id', 'id');
}
}