<?php

namespace Modules\Country\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
use Modules\Region\Models\Region;

class Country extends Model
{
    //use soft delete
    use SoftDeletes;

    protected $fillable =
    [
        'country_key','lock'
    ];

    /**
     * Get current description of the the Room
     * @return HasOne
     */
    public function currentDescription() :HasOne
    {
        return $this->hasOne(CountryDescription::class)->where('language_id', currentLanguage()->id);
    }
    public function regions()
    {
        return $this->hasMany(Region::class);
    }
}
