<?php

namespace Modules\Lpj\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\AnalisaFactory;

class Analisa extends Base
{
    use HasFactory;
    protected $table = 'analisa';
    /**
     * The attributes that are mass assignable.
     */
    protected $fillable = ['permohonan_id', 'type', 'luas', 'jenis_jaminan_id'];


    public function analisaTanahBangunan(){
        return $this->hasOne(AnalisaTanahBagunan::class, 'analisa_id');
    }


    public function analisaLingkungan(){
        return $this->hasOne(AnalisaLingkungan::class, 'analisa_id');
    }


    public function analisaFakta(){
        return $this->hasOne(AnalisaFakta::class, 'analisa_id');
    }

    public function jenisJaminan(){
        return $this->belongsTo(JenisJaminan::class, 'jenis_jaminan_id');
    }

    public function analisaUnit(){
        return $this->hasOne(AnalisaUnit::class, 'analisa_id');
    }


    protected static function newFactory(): AnalisaFactory
    {
        //return AnalisaFactory::new();
    }
}
