59 lines
1.1 KiB
PHP
59 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Modules\Booking\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class RoomAvailability extends Model
|
|
{
|
|
protected $fillable = [
|
|
'restaurant_id',
|
|
'hotel_id',
|
|
'room_id',
|
|
'date',
|
|
|
|
'total_inventory',
|
|
'available_inventory',
|
|
|
|
'is_available',
|
|
'is_closed_to_arrival',
|
|
'is_closed_to_departure',
|
|
|
|
'base_price',
|
|
'extra_adult_price',
|
|
'extra_child_price',
|
|
|
|
'min_stay',
|
|
'max_stay',
|
|
|
|
'blocked_by_booking_id',
|
|
'block_type',
|
|
'note',
|
|
|
|
'status',
|
|
'created_at',
|
|
'updated_at',
|
|
'deleted_at',
|
|
];
|
|
|
|
public const TABLE_NAME = 'room_availabilities';
|
|
|
|
protected $table = self::TABLE_NAME;
|
|
|
|
public function hotel(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Hotel::class);
|
|
}
|
|
|
|
public function room(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Room::class);
|
|
}
|
|
|
|
public function blockedByBooking(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Booking::class, 'blocked_by_booking_id');
|
|
}
|
|
}
|