<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Facility extends Model
{


    use HasFactory;

    protected $fillable = [
        'name',
        'is_icon',
        'icon_value',
        'scope',
        'is_published'
    ];

    protected $casts = [
        'is_icon' => 'boolean',
        'is_published' => 'boolean',
    ];


    public function rooms()
    {
        return $this->belongsToMany(Room::class);
    }

    public function images()
    {
        return $this->morphMany(Imageable::class, 'imageable');
    }
}
