Initial Commit; base feats
This commit is contained in:
commit
9732135e90
137 changed files with 13856 additions and 0 deletions
39
app/Models/Showing.php
Normal file
39
app/Models/Showing.php
Normal file
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Movie Theater Showings
|
||||
*/
|
||||
|
||||
class Showing extends Model
|
||||
{
|
||||
|
||||
protected $table = 'showings';
|
||||
protected $primaryKey = 'showing_id';
|
||||
protected $fillable = [
|
||||
'movie_id',
|
||||
'showing_start',
|
||||
'showing_end',
|
||||
'room_id', // which room is showing the movie?
|
||||
'user_id', // who added the showing?
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function movie()
|
||||
{
|
||||
return $this->belongsTo(Movie::class, 'movie_id', 'movie_id');
|
||||
}
|
||||
|
||||
public function nowPlaying()
|
||||
{
|
||||
return $this->where('showing_start', '>=', now())->get();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue