migrate to gtea from bistbucket
This commit is contained in:
65
public/restaurant/Modules/Booking/app/Models/Hotel.php
Normal file
65
public/restaurant/Modules/Booking/app/Models/Hotel.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Booking\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Modules\Authentication\Models\Restaurant;
|
||||
|
||||
class Hotel extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'name',
|
||||
'location',
|
||||
'email',
|
||||
'phone',
|
||||
'description',
|
||||
'latitude',
|
||||
'longitude',
|
||||
'check_in_time',
|
||||
'check_out_time',
|
||||
'status',
|
||||
];
|
||||
|
||||
/**
|
||||
* Casts
|
||||
*/
|
||||
protected $casts = [
|
||||
'latitude' => 'decimal:7',
|
||||
'longitude' => 'decimal:7',
|
||||
'check_in_time' => 'datetime:H:i',
|
||||
'check_out_time' => 'datetime:H:i',
|
||||
'status' => 'integer',
|
||||
];
|
||||
|
||||
public const TABLE_NAME = 'hotels';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
|
||||
public function restaurant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Restaurant::class);
|
||||
}
|
||||
|
||||
public function floors(): HasMany
|
||||
{
|
||||
return $this->hasMany(Floor::class);
|
||||
}
|
||||
|
||||
public function roomTypes(): HasMany
|
||||
{
|
||||
return $this->hasMany(RoomType::class);
|
||||
}
|
||||
|
||||
public function rooms(): HasMany
|
||||
{
|
||||
return $this->hasMany(Room::class);
|
||||
}
|
||||
|
||||
public function bookings(): HasMany
|
||||
{
|
||||
return $this->hasMany(Booking::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user