<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class PosCode extends Model
{
    use HasFactory;

    protected $fillable = [
        'code',
        'village',
        'district',
        'regency',
        'province',
        'latitude',
        'longitude',
        'elevation',
        'timezone',
    ];

    public function provinceRef(){
        return $this->belongsTo(Province::class,"provice_id","id");
    }

    public function cityRef(){
        return $this->belongsTo(City::class,"city_id","id");
    }

    public function districtRef(){
        return $this->belongsTo(City::class,"district_id","id");
    }

    public function subdistrictRef(){
        return $this->belongsTo(City::class,"subdistrict_id","id");
    }

}
