mega-commit: migrations, controllers, models, etc.
This commit is contained in:
parent
9732135e90
commit
2c6745e812
70 changed files with 2124 additions and 400 deletions
|
@ -15,6 +15,7 @@ class Room extends Model
|
|||
'room_rows',
|
||||
'room_columns',
|
||||
'user_id', // who added the room?
|
||||
'cinema_id',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
|
@ -22,10 +23,24 @@ class Room extends Model
|
|||
'updated_at',
|
||||
];
|
||||
|
||||
public static function find(int $room_id)
|
||||
{
|
||||
return self::where('room_id', $room_id)->first();
|
||||
}
|
||||
|
||||
public function showings()
|
||||
{
|
||||
return $this->hasMany(Showing::class, 'room_id', 'room_id');
|
||||
}
|
||||
|
||||
public function seats()
|
||||
{
|
||||
return $this->hasMany(Seat::class, 'room_id', 'room_id');
|
||||
}
|
||||
|
||||
public function cinema()
|
||||
{
|
||||
return $this->belongsTo(Cinema::class, 'cinema_id', 'cinema_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue