<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Iuran extends Model
{
    protected $fillable = [
        'warga_id', 'jenis_iuran', 'bulan', 'tahun', 'nominal',
        'tanggal_bayar', 'status', 'keterangan', 'bukti_bayar', 'user_id'
    ];

    protected $casts = [
        'tanggal_bayar' => 'date',
        'nominal' => 'integer',
    ];

    public function warga()
    {
        return $this->belongsTo(Warga::class);
    }

    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
