2025-03-24 13:31:06 +05:30
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class DeviceProfileMaster extends Model
|
|
|
|
|
{
|
|
|
|
|
use HasFactory;
|
|
|
|
|
|
|
|
|
|
protected $table = 'device_profile_master';
|
|
|
|
|
|
2025-03-25 11:34:55 +05:30
|
|
|
protected $keyType = 'string'; // Treat ID as a string
|
|
|
|
|
public $incrementing = false; // Disable auto-incrementing
|
|
|
|
|
|
2025-03-24 13:31:06 +05:30
|
|
|
protected $fillable = [
|
|
|
|
|
'id',
|
|
|
|
|
'name',
|
|
|
|
|
'description',
|
|
|
|
|
];
|
|
|
|
|
|
2025-03-25 11:34:55 +05:30
|
|
|
protected $casts = [
|
|
|
|
|
'id' => 'string',
|
|
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
2025-03-24 13:31:06 +05:30
|
|
|
public function devices()
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(Device::class, 'device_profile_id', 'id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function timeseriesKeys()
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(TimeseriesKeyMaster::class, 'device_profile_xid', 'id');
|
|
|
|
|
}
|
2025-03-25 11:34:55 +05:30
|
|
|
}
|