'boolean', 'IsPublish' => 'boolean', 'JenisKegiatanId' => 'integer', 'VerifikatorId' => 'integer', 'KelurahanId' => 'integer', ]; public function jenisKegiatan() { return $this->belongsTo(JenisKegiatan::class, 'JenisKegiatanId', 'JenisKegiatanId'); } protected $with = ['JenisKegiatan', 'Kelurahan']; public function kelurahan() { return $this->belongsTo(Kelurahan::class, 'KelurahanId', 'KelurahanId'); } public function kecamatan() { return $this->hasOneThrough( Kecamatan::class, Kelurahan::class, 'KelurahanId', // Foreign key di tabel Kelurahan 'KecamatanId', // Foreign key di tabel Kecamatan 'KelurahanId', // Foreign key di tabel Perusahaan 'KecamatanId' // Foreign key di tabel Kelurahan ); } public function kabupaten() { return $this->hasOneThrough( Kabupaten::class, Kecamatan::class, 'KecamatanId', // Foreign key di tabel Kecamatan 'KabupatenId', // Foreign key di tabel Kabupaten 'KelurahanId', // Foreign key di tabel Perusahaan 'KabupatenId' // Foreign key di tabel Kecamatan ); } public function verifikator() { return $this->belongsTo(Verifikator::class, 'VerifikatorId'); } // Relationship with JenisDokIL public function jenisDokIL() { return $this->belongsTo(JenisDokIL::class, 'JenisDokILId', 'JenisDokILId'); } public function refhistoryKegiatan() { return $this->belongsTo(RefHistoryKegiatan::class, 'RefHistoryKegiatanId', 'RefHistoryKegiatanId'); } public function historyPerusahaan(): HasMany { return $this->hasMany(HistoryPerusahaan::class, 'PerusahaanId', 'PerusahaanId'); } public function pelaporan() { return $this->belongsTo(PelaporanController::class, 'PelaporanId', 'PelaporanId'); } }