<?php

namespace App\Models\Pertanian;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\Wilayah\DesaKelurahan;
use App\Models\Pertanian\Lahan;

class Adat extends Model
{
    use SoftDeletes; 

    protected $table = 'adat';

    protected $fillable = [
        'nama',
        'desa_kelurahan_id',
        'created_by',
        'updated_by',
        'deleted_by',
    ];

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

    public function lahan()
    {
        return $this->hasMany(Lahan::class, 'adat_pemilik_id');
    }
}
