<?php

namespace App\Models;

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

class Sparepart extends Model
{
    use SoftDeletes;

    protected $fillable = ['name', 'code', 'image', 'stock', 'description', 'location'];

    public function transactions()
    {
        return $this->hasMany(SparepartTransaction::class);
    }

    public function loans()
    {
        return $this->hasMany(Loan::class);
    }
}
