<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class District
 * @package App\Models
 *
 * @property \App\Models\Country country_id
 * @property \App\Models\State state_id
 * @property string name
 * @property string postcode
 */
class District extends AbstractModel
{
    use SoftDeletes;

    protected $table = 'districts';

    protected $dates = ['deleted_at'];

    /**
     * @return BelongsTo
     */
    public function country(): BelongsTo
    {
        return $this->belongsTo(Country::class, 'country_id', 'id');
    }

    /**
     * @return BelongsTo
     **/
    public function state(): BelongsTo
    {
        return $this->BelongsTo(State::class, 'state_id', 'id');
    }
}
