<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class DeviceResultModel extends Model
{
    use HasFactory;
    protected $table = 'device_results';
    protected $primaryKey = 'uuid';
    public $timestamps = false;
    protected $fillable = [
        'uuid_device',
        'status_siaga',
        'depth_average',
        'datetime_start',
        'datetime_end',
        'datetime_calculate',
        'uuid_setting_siaga',
        'status_last',
        'last_time',
        'created'
    ];

    public function alat() {
        return $this->belongsTo(DeviceModel::class,'uuid_device');
    }

    public function device() {
        return $this->belongsTo(DeviceModel::class,'uuid_device','no');
    }
}
