50 lines
1.0 KiB
PHP
50 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Device extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'devices';
|
|
|
|
protected $fillable = [
|
|
'id',
|
|
'entity_type',
|
|
'created_time',
|
|
'tenant_id',
|
|
'customer_id',
|
|
'name',
|
|
'type',
|
|
'label',
|
|
'device_profile_id',
|
|
'firmware_id',
|
|
'software_id',
|
|
'external_id',
|
|
'version',
|
|
'active',
|
|
'additional_info',
|
|
'device_data',
|
|
];
|
|
|
|
protected $casts = [
|
|
'id' => 'string',
|
|
'tenant_id' => 'string',
|
|
'customer_id' => 'string',
|
|
'device_profile_id' => 'string',
|
|
'firmware_id' => 'string',
|
|
'software_id' => 'string',
|
|
'external_id' => 'string',
|
|
'additional_info' => 'array',
|
|
'device_data' => 'array',
|
|
];
|
|
|
|
public function asset()
|
|
{
|
|
return $this->belongsTo(Asset::class, 'asset_id', 'id');
|
|
}
|
|
|
|
} |