<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Question extends Model
{
    //
    use SoftDeletes;
     protected $fillable = [
        'id'
    ];
    public function descriptions($language_id = null) 
    {
    	$data = $this->hasMany(QuestionDescription::class,'question_id')->where('language_id', $language_id)->first();
         
            if(!$data){
                $data = $this->hasMany(QuestionDescription::class)->first();
            }
            
            return $data;
    }
}
