migrations and models
This commit is contained in:
33
app/Models/RoomType.php
Normal file
33
app/Models/RoomType.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RoomType extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'hotel_id',
|
||||
'name',
|
||||
'capacity',
|
||||
'base_price',
|
||||
];
|
||||
|
||||
public function hotel()
|
||||
{
|
||||
return $this->belongsTo(Hotel::class);
|
||||
}
|
||||
|
||||
public function bookings()
|
||||
{
|
||||
return $this->hasMany(Booking::class);
|
||||
}
|
||||
|
||||
public function availabilities()
|
||||
{
|
||||
return $this->hasMany(RoomAvailability::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user