<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Booking extends Model { protected $fillable = ['reference', 'user_id', 'room_id', 'booking_date', 'start_time', 'end_time', 'purpose', 'status', 'reviewed_by', 'reviewed_at', 'rejection_reason']; protected $casts = ['booking_date' => 'date:Y-m-d', 'reviewed_at' => 'datetime', 'created_at' => 'datetime']; public function user() { return $this->belongsTo(User::class); } public function room() { return $this->belongsTo(Room::class); } public function histories() { return $this->hasMany(BookingStatusHistory::class); } }
