mega-commit: migrations, controllers, models, etc.
This commit is contained in:
parent
9732135e90
commit
2c6745e812
70 changed files with 2124 additions and 400 deletions
|
@ -16,7 +16,6 @@ class Showing extends Model
|
|||
protected $fillable = [
|
||||
'movie_id',
|
||||
'showing_start',
|
||||
'showing_end',
|
||||
'room_id', // which room is showing the movie?
|
||||
'user_id', // who added the showing?
|
||||
];
|
||||
|
@ -26,6 +25,16 @@ class Showing extends Model
|
|||
'updated_at',
|
||||
];
|
||||
|
||||
public static function findOrfail($id)
|
||||
{
|
||||
return Showing::where('showing_id', $id)->firstOrFail();
|
||||
}
|
||||
|
||||
public function room()
|
||||
{
|
||||
return $this->belongsTo(Room::class, 'room_id', 'room_id');
|
||||
}
|
||||
|
||||
public function movie()
|
||||
{
|
||||
return $this->belongsTo(Movie::class, 'movie_id', 'movie_id');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue