32 lines
584 B
PHP
32 lines
584 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Availability extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'room_type_id',
|
|
'start_date',
|
|
'end_date',
|
|
'is_available',
|
|
'price',
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_available' => 'boolean',
|
|
'start_date' => 'date',
|
|
'end_date' => 'date',
|
|
'price' => 'decimal:2',
|
|
];
|
|
|
|
public function roomType()
|
|
{
|
|
return $this->belongsTo(RoomType::class);
|
|
}
|
|
}
|