<?php

namespace App\Models;

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

class Surat extends Model
{
    use SoftDeletes;

    protected $fillable = [
        'nomor_surat', 'jenis_surat', 'warga_id', 'tanggal_surat',
        'keperluan', 'keterangan', 'status', 'file_surat', 'user_id'
    ];

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

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

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