<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Equipment extends Model
{
    use SoftDeletes;

    protected $table = 'equipments';

    protected $fillable = ['name', 'category', 'hourly_rate', 'min_rate', 'daily_rate', 'shifting_charge', 'history'];

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

    public function workRecords()
    {
        return $this->hasMany(WorkRecord::class);
    }
}
