<?php

namespace App\Models;

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

class Room extends Model
{
    use HasFactory;

    protected $table = 'rooms'; // Nama tabel
    protected $primaryKey = 'id_kamar'; // Pastikan primary key sesuai dengan database
    public $incrementing = true; // Karena id_kamar auto increment
    protected $keyType = 'int'; // Pastikan tipe data sesuai
    public $timestamps = false; // Nonaktifkan timestamps

    protected $fillable = [
        'room_number',
        'room_type',
        'harga',
        'status',
        'lantai',
        'fasilitas',
        'foto',
        'deskripsi'
    ];

    public function bookings()
    {
        return $this->hasMany(Booking::class, 'id_kamar', 'id_kamar');
    }
}
