<?php

namespace App\Models;

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

class DataIbuHamil extends Model
{
    use HasFactory;
    protected $table = 'data_ibu_hamil';
    protected $guarded = ['id']; //nggak boleh di isi

    public function createDataBalita()
    {
        return $this->hasOne(DataBalita::class, 'ibu_hamil_id', 'id');
    }

    public function pemeriksaan()
    {
        return $this->hasMany(DataPeriksaIbuHamil::class, 'ibu_hamil_id', 'id');
    }

    // public function detile()
    // {
    //     return $this->hasOne(Surat::class, 'detail_surat_id', 'id');
    // }
}
