<?php

namespace App;

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

class Feature extends Model
{
    use SoftDeletes;

    protected $fillable = ['image'];

    public static function widthDescription()
    {
        $language_id = currentLanguage()->id;
        return self::join('feature_descriptions as fd', 'fd.feature_id', 'features.id')
            ->where('fd.language_id', $language_id)->select(['features.*', 'fd.title', 'fd.description'])->get();
    }
}
