<?php

namespace Modules\Area\Models;

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

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

    protected $fillable = [
        'city_id'
    ];


    /**
     * Get current description of the the Room
     * @return HasOne
     */
    public function city()
    {
        return $this->belongsTo(City::class)->withTrashed();
    }

    public function currentDescription() :HasOne
    {
        return $this->hasOne(AreaDescription::class)->where('language_id', currentLanguage()->id);
    }
}
