<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class RiwayatPrediksi extends Model
{
    protected $table = 'riwayat_prediksi';

    protected $fillable = [
        'user_id',
        'nama',
        'jenis_kelamin',
        'umur',
        'gejala',
        'stres',
        'merokok',
        'alkohol',
        'obat',
        'hasil',
        'indikasi',
    ];

    protected $casts = [
        'gejala' => 'array',
        'indikasi' => 'array', // otomatis convert JSON ke array
    ];

    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
