31 lines
719 B
PHP
31 lines
719 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class RiwayatDiagnosaDetail extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'riwayat_diagnosa_detail';
|
|
|
|
protected $fillable = ['riwayat_id', 'gejala_kode', 'penyakit_kode', 'cf_tertinggi'];
|
|
|
|
public function riwayat()
|
|
{
|
|
return $this->belongsTo(RiwayatDiagnosa::class, 'riwayat_id');
|
|
}
|
|
|
|
public function penyakit()
|
|
{
|
|
return $this->belongsTo(\App\Models\Penyakit::class, 'penyakit_kode'); // penyakit_kode = id penyakit
|
|
}
|
|
|
|
public function gejala()
|
|
{
|
|
return $this->belongsTo(\App\Models\Gejala::class, 'gejala_kode');
|
|
}
|
|
}
|