<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Riwayat extends Model
{
    use HasFactory;
    protected $table = 'riwayat_jawaban';
    protected $primaryKey = 'id_jawaban';
    protected $fillable = [
        'id_jawaban',
        'waktu',
        'jawaban',
        'persen',
        'penyakit',
        'id_user'
    ];

    public $timestamps = false;

    public function solusi()
    {
        return $this->hasOne(Penyakit::class, 'nama_penyakit', 'penyakit');
    }
}
