<?php

namespace App\Models;

use App\Traits\UuidPrimaryKey;
use App\Exceptions\ModelNotFoundException;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class CompraIngrediente extends Model {
    use UuidPrimaryKey, SoftDeletes;

    protected $table = 'compra_ingredientes';
    protected $hidden = ['created_at', 'updated_at', 'deleted_at', 'pivot'];
    protected $fillable = ['id', 'unidades', 'monto_unitario', 'compra_id', 'ingrediente_id'];

    public function ingrediente() {
        return $this->belongsTo(Ingrediente::class);
    }

    public function compra() {
        return $this->belongsTo(Compra::class);
    }
}
