37 lines
687 B
PHP
37 lines
687 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Models;
|
||
|
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
||
|
class Seat extends Model
|
||
|
{
|
||
|
|
||
|
protected $table = 'seats';
|
||
|
protected $primaryKey = 'seat_id';
|
||
|
public $timestamps = false;
|
||
|
protected $fillable = [
|
||
|
'seat_row',
|
||
|
'seat_number',
|
||
|
'seat_type', // enum('standard', 'wheelchair', 'loveseat')
|
||
|
'room_id',
|
||
|
];
|
||
|
|
||
|
protected $hidden = [
|
||
|
'created_at',
|
||
|
'updated_at',
|
||
|
];
|
||
|
|
||
|
public function room()
|
||
|
{
|
||
|
return $this->belongsTo(Room::class, 'room_id', 'room_id');
|
||
|
}
|
||
|
|
||
|
public function orders()
|
||
|
{
|
||
|
return $this->belongsToMany(Order::class, 'order_seats', 'seat_id', 'order_id');
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|