<?php

namespace App\Models;

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

class ResepItem extends Model
{
    protected $fillable = [
        'resep_id',
        'obat_masuk_id',
        'nama_obat',
        'jumlah',
        'aturan_pakai',
    ];

    /**
     * Relasi ke Resep
     */
    public function resep(): BelongsTo
    {
        return $this->belongsTo(Resep::class);
    }

    /**
     * Relasi ke ObatMasuk
     */
    public function obatMasuk(): BelongsTo
    {
        return $this->belongsTo(ObatMasuk::class);
    }
}
