<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Warga extends Model
{
    use SoftDeletes;

    protected $fillable = [
        'nik', 'kk', 'nama', 'jenis_kelamin', 'tempat_lahir', 'tanggal_lahir',
        'alamat', 'rt', 'rw', 'kelurahan', 'kecamatan', 'kota', 'provinsi',
        'telepon', 'email', 'status_perkawinan', 'pekerjaan', 'status_warga', 'keterangan'
    ];

    protected $casts = [
        'tanggal_lahir' => 'date',
    ];

    public function mutasi()
    {
        return $this->hasMany(MutasiWarga::class);
    }

    public function surats()
    {
        return $this->hasMany(Surat::class);
    }

    public function iurans()
    {
        return $this->hasMany(Iuran::class);
    }
}
