<?php

namespace Modules\FaqCategory\Models;

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

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

    protected $fillable =
    [
        'id'
    ];

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

    public function faqs()
    {
        return $this->hasMany(Faq::class);
    }
}
