Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Successful in 19s
Laravel Larastan / larastan (pull_request) Failing after 3m51s
Laravel Pint / pint (pull_request) Failing after 3m49s
52 lines
1.0 KiB
PHP
52 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Item extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $fillable = [
|
|
'plant_id',
|
|
'category',
|
|
'code',
|
|
'description',
|
|
'hourly_quantity',
|
|
'uom',
|
|
];
|
|
|
|
public function plant(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Plant::class);
|
|
}
|
|
|
|
public function stickerMasters()
|
|
{
|
|
return $this->hasMany(StickerMaster::class, 'item_id', 'id');
|
|
}
|
|
|
|
public function productionQuantities()
|
|
{
|
|
return $this->hasMany(ProductionQuantity::class);
|
|
}
|
|
|
|
public function motorTestingMasters()
|
|
{
|
|
return $this->hasMany(MotorTestingMaster::class);
|
|
}
|
|
|
|
public function testingPanelReadings()
|
|
{
|
|
return $this->hasMany(TestingPanelReading::class);
|
|
}
|
|
|
|
public function itemCharacteristics()
|
|
{
|
|
return $this->hasMany(ItemCharacteristic::class, 'item_id', 'id');
|
|
}
|
|
}
|