50 lines
1011 B
PHP
50 lines
1011 B
PHP
<?php
|
|
|
|
namespace Modules\Booking\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Modules\Authentication\Models\User;
|
|
|
|
class RoomBlock extends Model
|
|
{
|
|
protected $fillable = [
|
|
'restaurant_id',
|
|
'hotel_id',
|
|
'room_id',
|
|
'start_date',
|
|
'end_date',
|
|
'start_time',
|
|
'end_time',
|
|
'block_type',
|
|
'blocked_inventory',
|
|
'priority',
|
|
'reason',
|
|
'auto_release',
|
|
'created_by',
|
|
'status',
|
|
'created_at',
|
|
'updated_at',
|
|
'deleted_at',
|
|
];
|
|
|
|
public const TABLE_NAME = 'room_blocks';
|
|
|
|
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 creator(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
}
|
|
}
|