<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOne;

class DistrictMapping extends Model
{
    use HasFactory;

    //link to table
    protected $table = "DISTRICT_MAPPING";

    //link to PK
    protected $primaryKey= 'IPRS_DISTRICT_ID';


    /**
     * Relate to ADDRESS
     * @return HasMany
     */
    public function districtAddress(): HasMany
    {
        return $this->hasMany(Address::class, 'distr','iprs_district_id');
    }

}
