1
0
forked from poc/pds

Added machine migration, model, resource with dependencies

This commit is contained in:
dhanabalan
2025-05-31 09:00:11 +05:30
parent 68060fe5fc
commit 46eaa273c3
7 changed files with 265 additions and 0 deletions

33
app/Models/Machine.php Normal file
View File

@@ -0,0 +1,33 @@
<?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',
'name',
];
public function plant(): BelongsTo
{
return $this->belongsTo(Plant::class);
}
public function line(): BelongsTo
{
return $this->belongsTo(Line::class);
}
public function testingPanelReadings()
{
return $this->hasMany(TestingPanelReading::class);
}
}