mirror of
https://github.com/usetrmnl/larapaper.git
synced 2026-08-13 14:28:54 -07:00
30 lines
615 B
PHP
30 lines
615 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\DeviceSensorKind;
|
|
use App\Enums\DeviceSensorSource;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class DeviceSensor extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'kind' => DeviceSensorKind::class,
|
|
'source' => DeviceSensorSource::class,
|
|
];
|
|
}
|
|
|
|
public function device(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Device::class);
|
|
}
|
|
}
|