<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
 * @method static where(string $string, mixed $id)
 * @method static updateOrCreate(array $array, array $array1)
 */
class InstallerConsumable extends Model
{
    protected $fillable = [
        'installer_id',
        'consumable_id',
        'stock'
    ];

    public function installer(): BelongsTo
    {
        return $this->belongsTo(User::class, 'installer_id');
    }

    public function consumable(): BelongsTo
    {
        return $this->belongsTo(Consumable::class);
    }

}
