<?php

namespace App\Models;

use App\Traits\Description;
use App\Traits\Image;
use App\Traits\ImageCompressor;
use App\Traits\Slug;
use App\Traits\Title;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

class Room extends Model
{
    use HasFactory,Slug,Description,ImageCompressor,Image,Title;


    protected $fillable =[
        'slug',
        'category_id',
        'image',
        'video',
        'price',
        'title_az',
        'title_ru',
        'title_en',
        'description_az',
        'description_ru',
        'description_en',
        'show_in_main',
        'partners*',
    ];


    public function roomCategory()
    {
        return $this->belongsTo(RoomCategory::class, 'category_id');
    }

    public function room_gallery(): HasMany
    {
        return $this->hasMany(RoomGallery::class);
    }

}
