<?php

namespace App\Models\Master;

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

class Kecamatan extends Model
{
    use HasFactory;
    protected $table = 'ms_kecamatan';
    protected $primaryKey = 'MsKecamatanId';

    protected $fillable = [
        'ms_provinsi_id',
        'ms_kabupaten_id',
        'name',
        'kode_wilayah',
    ];

    public function provinsi()
    {
        return $this->belongsTo('\App\Models\Master\Provinsi','ms_provinsi_id','MsProvinsiId');
    }

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