<?php

namespace App\Models;

use App\Models\Kriteria;
use App\Models\Makanan;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class KriteriaMakanan extends Model
{
    use HasFactory;
    protected $table = 'kriteria_makanan';
    protected $primaryKey = 'id';
    protected $fillable = [
        'kriteria_id',
        'makanan_id',
        'nilai',
        'keterangan',
    ];
    public function kriteria()
    {
        return $this->belongsTo(Kriteria::class, 'kriteria_id');
    }

    public function makanan()
    {
        return $this->belongsTo(Makanan::class, 'makanan_id');
    }
}
