<?php

namespace App\Models\Machine;

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

class MachineLog extends Model
{
    use HasFactory;

    const UPDATED_AT = null;

    protected $fillable = [
        'company_id',
        'machine_id',
        'level',
        'type',
        'message',
        'context',
    ];

    protected $casts = [
        'context' => 'array',
    ];

    public function machine()
    {
        return $this->belongsTo(Machine::class);
    }
}
