Merge pull request 'Added item and plant models' (#67) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

Reviewed-on: #67
This commit was merged in pull request #67.
This commit is contained in:
2025-12-23 12:19:20 +00:00
2 changed files with 12 additions and 2 deletions

View File

@@ -3,15 +3,15 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class Item extends Model
{
use SoftDeletes;
protected $fillable = [
"plant_id",
'plant_id',
'category',
'code',
'description',
@@ -43,4 +43,9 @@ class Item extends Model
{
return $this->hasMany(TestingPanelReading::class);
}
public function itemCharacteristics()
{
return $this->hasMany(ItemCharacteristic::class, 'item_id', 'id');
}
}

View File

@@ -102,4 +102,9 @@ class Plant extends Model
{
return $this->hasMany(User::class, 'plant_id', 'id');
}
public function itemCharacteristics()
{
return $this->hasMany(ItemCharacteristic::class, 'plant_id', 'id');
}
}