34 lines
674 B
PHP
34 lines
674 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Rule extends Model
|
|
{
|
|
use HasFactory;
|
|
protected $table = 'tbl_rule';
|
|
protected $primaryKey = 'id_rule';
|
|
protected $fillable = [
|
|
'id_rule',
|
|
'kode_rule',
|
|
'kode_gejala',
|
|
'kode_penyakit',
|
|
'md',
|
|
'mb'
|
|
];
|
|
|
|
public $timestamps = false;
|
|
|
|
public function penyakit()
|
|
{
|
|
return $this->hasOne(Penyakit::class, 'kode_penyakit', 'kode_penyakit');
|
|
}
|
|
|
|
public function gejala()
|
|
{
|
|
return $this->hasOne(Gejala::class, 'kode_gejala', 'kode_gejala');
|
|
}
|
|
}
|