<?php

namespace App\Models;

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

use App\Models\User;
use App\Models\Wilayah\DesaKelurahan;

class Profile extends Model
{
    use SoftDeletes; 

    protected $fillable = [
        'user_id',
        'role',
        'nama',
        'email',
        'telepon',
        'alamat',
        'kk',
        'ktp',
        
        'desa_kelurahan_id',
        'path_kk',
        'file_kk',
        'path_ktp',
        'file_ktp',
        'keluarga_id',
        'created_by',
        'updated_by',
        'deleted_by'
    ];

    public function desaKelurahan()
    {
        return $this->belongsTo(DesaKelurahan::class, 'desa_kelurahan_id');
    }

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