<?php

namespace app\Http\Models;

use Illuminate\Database\Eloquent\Model;

class PeriodeKehamilan extends Model
{
    protected $table = 'periode_kehamilan';
    protected $fillable = ['id_periode','bumil_id','alamat_domisili','kabupaten_domisili_id','kecamatan_domisili_id','desa_domisili_id','usia_ibu','usia_kehamilan','kehamilan','jarak_bulan','jarak_tahun','gol_darah','status_kehamilan','keterangan_kehamilan','tlg_simpan','users_id'];
    protected $primaryKey = "id_periode";
    public $timestamps = false;

    public function bumil(){
        return $this->belongsTo('App\Http\Models\IbuHamil','bumil_id');        
    }

    public function kabupaten(){
        return $this->belongsTo('App\Http\Models\Kabupaten','kabupaten_domisili_id');        
    }

    public function kecamatan(){
        return $this->belongsTo('App\Http\Models\Kecamatan','kecamatan_domisili_id');        
    }

    public function desa(){
        return $this->belongsTo('App\Http\Models\Desa','desa_domisili_id');        
    }

    public function users(){
        return $this->belongsTo('App\Http\Models\Users','users_id');        
    }
}
