<?php

namespace App;

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

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